> For the complete documentation index, see [llms.txt](https://gitbook.testingwaters.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.testingwaters.in/geometry-1/spherical-transformations.md).

# Spherical Transformations

![](/files/-LhLzMSiGur6B8K7LQuh)

{% file src="/files/-Lh9HMZ1qSjhYX98y-yG" %}

```d
//Spherical Transformations 

n = 11;
x = Math.Sin(0..180..#n)<1>*Math.Cos(0..360..#n);
y = Math.Sin(0..180..#n)<1>*Math.Sin(0..360..#n);
z = Math.Cos(0..180..#n);

//Sphere
p1 = Point.ByCoordinates(x<1>,y<1>,z<1><2>);

//Sphere Translated and Scaled along Z-Axis
p2 = Point.ByCoordinates(x<1>,y<1>,((0.75+z)/(1.75..2..#n))<1><2>);

//Sphere Translated and Scaled along X-Axis
p3 = Point.ByCoordinates(((x+0.75)*(1..3..#n))<1>,y<1>,z<1><2>);
```

![](/files/-Lfzp0Ib_boXt6-Xg6cI)

Dome Transformations

![](/files/-LlGg21D6bIoqoXqBveh)

```d
//Dome Transformations

n = 11;
x = Math.Sin(0..90..#n)<1>*Math.Cos(0..360..#n);
y = Math.Sin(0..90..#n)<1>*Math.Sin(0..360..#n);
z = Math.Cos(0..90..#n);

//Dome
p1 = Point.ByCoordinates((x*(mnx..(mnx+mxs)..#n))<1>,
y<1>,(z/(mnz..(mnz+mxz)..#n))<1><2>);
```

![Asymmetric Vertical Scaling](/files/-MM-hFvRUpxbdNCQ-RbM)

```d
u = 0..360..#50;
v = 0..180..#50;
x = (Math.Cos(u) * Math.Sin(v)<1>) * 1.25;
y = (Math.Sin(u) * Math.Sin(v)<1>) * 1.65;
z = Math.Pow(Math.Cos(0..55..#50),8)*-2+2;

NurbsSurface.ByPoints(Point.ByCoordinates(x,y,z));
```
