# C# to MakeCode

**URL:** <https://forum.makecode.com/t/c-to-makecode/4534>\
**Category:** Help\
**Created:** [November 20, 2020, 9:40pm UTC](https://forum.makecode.com/t/c-to-makecode/4534 "2020-11-20T21:40:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sven](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Sven](https://forum.makecode.com/u/Sven)\
**Post date:** [November 20, 2020, 9:40pm UTC](https://forum.makecode.com/t/c-to-makecode/4534/1 "2020-11-20T21:40:18Z")

</div>

Hi, so I’ve been using unity and C# for some time now and I used to make bolls with some code.  
this is an example:

> ```
> for (int i = 0; i < numPoints.Length; i++)
> {
> float t = i / (numPoints.Length - 1f);
> float inclination = Mathf.Acos(1 - 2 * t);
> float azimuth = speed * Mathf.PI * turnFraction * i;
> 
> float x = Mathf.Sin(inclination) * Mathf.Cos(azimuth);
> float y = Mathf.Sin(inclination) * Mathf.Sin(azimuth);
> float z = Mathf.Cos(inclination);
> 
> numPoints[i].transform.position = new Vector3(x * distanceMultiplier, y * distanceMultiplier, z * distanceMultiplier);
> }
> 
> ```

numPoints is an array of objects.  
speed is just a float,  
turnFraction is a float  
and DistanceMultiplier is a float too.

Does anyone know how to transform this code in to MakeCOde/java?  
thanks!

---

<div class="post-metadata">

**Author:** ![charliegregg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/charliegregg/32/2411_2.png) [@charliegregg](https://forum.makecode.com/u/charliegregg)\
**Post date:** [November 21, 2020, 3:41am UTC](https://forum.makecode.com/t/c-to-makecode/4534/2 "2020-11-21T03:41:41Z")

</div>

Well I’m no professional but here is what I would do:

> **[c# to java](https://arcade.makecode.com/64053-31943-57688-11502)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

There is no built in Vector3 class so I just added one  
and I’m not sure what object numPoints is so just made it a Vector3[]

Hope this helps!
