Math. Coding???

About advanced scenes, and the Thyme scripting language used in Algodoo.

Math. Coding???

Postby niffirg1 » Sun Nov 08, 2009 3:48 am

I still have no clue what math. is used for. Like what are the uses of this i have seen it in many scenes like RA2Lovers mouse pointer. What is Math. used for i have scene math.round, math.atan, etc.
User avatar
niffirg1
 
Posts: 376
Joined: Mon Aug 31, 2009 10:31 pm
Location: The Great American South!

Re: Math. Coding???

Postby KarateBrot » Sun Nov 08, 2009 9:59 am

math.* are math functions like sine, cosine, tangent, multiply, divide, ...

for example "math.multiply(3,4)" is similar to 3*4
"math.sin(3)" will give the value of sin(3). in algodoo you also can write "sin(3)" instead of "math.sin(3)"

btw. atan is the inverse function for tan. it's used to calculate angles. that's no invention of thyme, it has something to do with trigonometric functions.

in phun those functions are just with "math." in front of them because you can tell the math functions apart from other function types like "scene.", "sim." etc. more easy.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Math. Coding???

Postby niffirg1 » Mon Nov 09, 2009 4:17 am

Oh i know trigonometry or at least the cos, tan and sin and the inverses of the three i just did not know how to use math coding
User avatar
niffirg1
 
Posts: 376
Joined: Mon Aug 31, 2009 10:31 pm
Location: The Great American South!

Re: Math. Coding???

Postby jessebax129 » Wed Jan 06, 2010 6:57 pm

but is math.atan the same as tan-1 ? :crazy: tan-1 means tan and than the -1 is smal.... like squire 2 ( i can't type it is this box ) :cry:
jessebax129
 
Posts: 34
Joined: Tue Jan 05, 2010 6:32 pm

Re: Math. Coding???

Postby RA2lover » Thu Jan 07, 2010 4:58 pm

tan^-1(x) = arctangent(x) = math.atan(x).
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Math. Coding???

Postby KarateBrot » Sat Jan 09, 2010 4:16 pm

jessebax129 wrote:but is math.atan the same as tan-1 ? :crazy: tan-1 means tan and than the -1 is smal.... like squire 2 ( i can't type it is this box ) :cry:


he meant tan^(-1). but that doesn't mean "tan to the power of -1" because that would be 1/tan. for inverse functions ^(-1) is used very often to mark them as those. and the inverse function for tan is the arc tangent. it looks like a part of the tangent put rotated about 90°.

and yes, atan is the same as tan^(-1) if tan^(-1) means the inverse function of tan.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 9 guests