mc-Things

mc-Products => mc-Studio => Topic started by: Bartw on February 16, 2017, 08:26:57 pm

Title: Maths library or functions ??
Post by: Bartw on February 16, 2017, 08:26:57 pm
Hello

Are there any maths libraries for square root, sin/cos/tan etc?
I am gather there isn't but being hopeful.

Regards
Bart
Title: Re: Maths library or functions ??
Post by: mc-Josh on February 17, 2017, 10:21:03 am
There are math functions in mcScript, they are part of the Float object which is documented in the mcScript User Guide (section 5.2.6 and 16.6).

See sample code below:

Code: [Select]
Dim someFloat As Float = 81
Dim someFloat2 As Float = 90
Dim sqrtOfFloat As Float = someFloat.Sqrt
Dim sinOfFloat As Float = someFloat2.Sin
Dim cosOfFloat As Float = someFloat2.Cos

Note: Sin and Cos are in Radians.
Title: Re: Maths library or functions ??
Post by: Bartw on February 19, 2017, 03:12:34 pm
Awesome thank you.
Regards
Bart