USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 4/28/09 10:19 PM
Sign-Up: 04/17/04
Posts: 4,445
Getting a random point, where the point mustreside at some point inside of a circle.
1st 2 steps... no problem.
1) Generate a random angle. 2) Generate a random distance, where the max is the radius of the circle.
Yet, I can't finish the process of getting the X and Y of the new point. I'm not sure if I have to convert to radians, and apply sin/cos/tan (or inverses).
I feel like a retard. Thanks!
All sites currently down. Deal with it. <3
Posted at: 4/28/09 10:27 PM
Sign-Up: 06/02/05
Posts: 5,193
x = distance * Math.cos(radians) y = distance * Math.sin(radians)
Hypothetically, it doesn't matter if it's in radians or degrees, because it will always be within the domain of sin and cos. And the distance is the radius.
MY E-PENIS IS BIGGER THAN YOURS 8=================================> ...and this is my fag...
Posted at: 4/28/09 10:58 PM
Sign-Up: 01/05/09
Posts: 244
YOU feel like retard? I don't even know trigonometry yet. :(
mmm.
Posted at: 4/28/09 11:14 PM
Sign-Up: 02/22/08
Posts: 1,482
At 4/28/09 10:27 PM, El-Presidente wrote: x = distance * Math.cos(radians) y = distance * Math.sin(radians) Hypothetically, it doesn't matter if it's in radians or degrees, because it will always be within the domain of sin and cos. And the distance is the radius.
Another note: Since I'm a mega h8r of radians, I also find myself converting shit from radians to degrees.... it's really just as simple as...
( ValueInRadians * 180 ) / Math.Pi = ValueInDegrees --and vice versa-- ( ValueInDegrees * Math.Pi ) / 180 = ValueInRadians
:: AS2: Main :: AS3: Main :: C++: Main :: I speak German =3
Posted at: 4/28/09 11:26 PM
At 4/28/09 11:14 PM, DawnOfDusk wrote: Another note: Since I'm a mega h8r of radians, I also find myself converting shit from radians to degrees.... it's really just as simple as... ( ValueInRadians * 180 ) / Math.Pi = ValueInDegrees
Yeah, I've done a bunch of work with angular velocity (x+= Math.sin(angle)*speed)... but for the life of me couldn't figure out how to plot a simple point inside a circle.
Thanks Elly-P. Figured it was something simple.
All times are Eastern Standard Time (GMT -5) | Current Time: 06:39 PM
<< Back