square root and the square?

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

square root and the square?

Postby Torpedo » Tue Sep 01, 2009 11:37 pm

Trying to do Pythagoras to find a length using the vectors, but I cant find anything in the wiki on how to do either. Can anyone help?

On a side note, isnt it about time a full thyme guide with syntax and examples were made by those in the know? its isnt half annoying getting stuck all the time with very few resources (and those that are there, are often writen from different perspectives and difficultly level to related material, making it hard to understand what they've said) come on!
Image
User avatar
Torpedo
 
Posts: 120
Joined: Mon Aug 31, 2009 8:51 pm

Re: square root and the square?

Postby Rhett97 » Wed Sep 02, 2009 12:31 am

yeah i think some of our EXPERT thymers (Emil,Grady,Kile,Para,Conun) should all make like a Free E-book or a Wiki book for all Phunners.....
Chronos wrote:There's nothing wrong with swearing. They're just words. People just think they have a bad meaning. What's the difference between shit and poo? Nothing. They're the same.
User avatar
Rhett97
 
Posts: 522
Joined: Mon Aug 31, 2009 10:32 pm

Re: square root and the square?

Postby standardtoaster » Wed Sep 02, 2009 1:33 am

Rhett97 wrote:yeah i think some of our EXPERT thymers (Emil,Grady,Kile,Para,Conun) should all make like a Free E-book or a Wiki book for all Phunners.....

That's what am working on. :crazy: If anybody would like to help please PM me. :D
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: square root and the square?

Postby Conundrumer » Wed Sep 02, 2009 2:32 am

Are you talking about the distance formula?
Also, since when was I an expert thymer?
User avatar
Conundrumer
 
Posts: 344
Joined: Mon Aug 31, 2009 5:55 pm
Location: NYC

Re: square root and the square?

Postby Versieon » Wed Sep 02, 2009 2:48 am

Yea, I thought you hated thyme :lol:
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: square root and the square?

Postby a Mammoth » Wed Sep 02, 2009 3:12 am

Just use the ^ thing. So square root is for example: (Mammoth)^0.5 and squared is (Mammoth)^2. Cool Mammoth squared!
a Mammoth
 
Posts: 66
Joined: Tue Sep 01, 2009 3:46 am

Re: square root and the square?

Postby xplane80 » Wed Sep 02, 2009 10:42 am

The ^ is a carat/caret it can signify an exponent (3^4 or 3*3*3*3) or can be a logical operation to signify XOR (Exclusive Or) or AND.
Image<- Designed by PhysicsGuy
User avatar
xplane80
 
Posts: 498
Joined: Mon Aug 31, 2009 7:28 pm

Re: square root and the square?

Postby KarateBrot » Thu Sep 03, 2009 3:24 pm

You only need to know a bit of math. if you know how to do exponents in thyme that's all what you need. btw it's "math.pow(x,y)" or just type "x^y"

So what you need is
Code: Select all
scene.my.distance =
((scene.my.pos2(0) - scene.my.pos1(0))^2 + (scene.my.pos2(1) - scene.my.pos1(1))^2)^0.5
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: square root and the square?

Postby Torpedo » Thu Sep 03, 2009 11:21 pm

that sorta solved my problem, scenes acting all weird though and sometimes pulling numbers that arent right :S cant figure out why though.
Image
User avatar
Torpedo
 
Posts: 120
Joined: Mon Aug 31, 2009 8:51 pm

Re: square root and the square?

Postby electronicboy » Thu Sep 03, 2009 11:58 pm

Rhett97 wrote:yeah i think some of our EXPERT thymers (Emil,Grady,Kile,Para,Conun) should all make like a Free E-book or a Wiki book for all Phunners.....

don't you mean algodoers? and i support an ebook or what ever!
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 3 guests