Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Triangle Rotation?
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Delta




PostPosted: Fri Aug 13, 2004 3:34 pm   Post subject: Triangle Rotation?

Ok guys, I suck horribly at math mainly because it's evil... but ya... can anyone explain to me how to find the middle point of a circle (possibly called the centroid)... and then how I would go about spinning the triangle around that point.... any help would be much appreciated. Thank you.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Fri Aug 13, 2004 5:04 pm   Post subject: (No subject)

In a two dimensional plane, any three points can only fall on a single circle.

To find the center of that circle, a common problem in architecture, by the way, first connect the three points with two lines. Find the equations of these lines. Now, find the equations of two lines which pass through the centerpoints of those two lines, such that both of these new lines are perpendicular to the old lines. Now you just need to find the intersection points of the new lines and you have the center of the circle.
Delta




PostPosted: Fri Aug 13, 2004 10:35 pm   Post subject: (No subject)

Shocked yes... wait... ummm lol seriously that just blew me off my chair... that and the leg broke so I'm standing up now... anyways... could you help me out equation wise at least... like explain the equations needed? Sorry but I really suxorz when it comes to math (our math teacher pissed me off early on... so now I'm an idiot)
Martin




PostPosted: Sat Aug 14, 2004 1:03 pm   Post subject: (No subject)

Okay. First thing you need is a circle. You know, (x-a)^2 + (y-b)^2 = r^2, where a and b are the x and y co-ordinates of the center of the circle.

So what is a circle anyway? The definition is: a set of points equidistant from a fixed point. Makes sense?

Any three distinct points inside a circle will form a triangle. Also, every triangle in the world fits inside a circle of some size, such that each of the triangles vertecies are touching a point on the circle.

Now, first thing: rotating a point around a circle. All that you have to do here is use angles (degrees or radians work, I prefer radians, they make more sense). Any point on the circle can be found by
pointx = a + r * cos (angle);
pointy = b + r * sin (angle);

To rotate a point, simply change the angle. To change three points, you simply have to change the angle for all three of them by the same amount.

And, if all that you want to do is rotate a triangle about that point, you can already see that that is what is happening.

I hope this helps.
Delta




PostPosted: Sat Aug 14, 2004 2:50 pm   Post subject: (No subject)

Much clearer thank you both
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: