> 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

Transforming with equations

![](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-LhLyFP3rAPFAfw0YfRG%2F-LhLzMSiGur6B8K7LQuh%2Fsphere.gif?alt=media\&token=f745feb0-f24c-4df6-854e-0bd6613d5a7a)

{% 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>);
```

![](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-LfzocI5pG3xZndglbmD%2F-Lfzp0Ib_boXt6-Xg6cI%2FsphericalShapes.png?alt=media\&token=c576eabf-f235-4181-b767-bd8267898ffc)

Dome Transformations

![](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-LlGeI-VuwbWUU6x1tyX%2F-LlGg21D6bIoqoXqBveh%2Fdome.gif?alt=media\&token=2448dd91-0bc0-43c4-b79f-0dd76a62331f)

```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](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MM-gfiRaCkn7z4a326y%2F-MM-hFvRUpxbdNCQ-RbM%2FasymmetrictransformationSphere.png?alt=media\&token=d2befbe3-dc25-49c6-828e-34db8128cdac)

```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));
```
