How do I do Circle Math..lol

Get help using Construct 2

Post » Tue Jan 20, 2015 3:32 pm

Ok I have been trying to figure this out myself but been stumbling over it too long and wanted some real math people to help me here.

I have the X,Y of my initial Touch, with my touch I pull back in any direction (think like Angry birds) which I then have the angle of my initial touch and my current touching point.

What I need is to be able to get the X,Y of a point the opposite angle I am pulling but only a certain amount of pixels. So essentially, where I am pulling back there should be a dot on the opposite side of the circle but only 30 px from the center point (not the distance of my current touch to the center, just a set amount). So I can just drag around and there should be a dot making a perfect circle at the same distance away from the center point.

Does that make sense?

I had been trying to set the dot using a formula I saw on here but it's not working on most angles.
X = X + 30 * cos(angle)
Y= Y + 30 * cos(angle)

Any help would be fantastic!
Twitter: https://twitter.com/pudgyplatypus

Learn to make a clicker game for cheap!
https://www.scirra.com/store/games-with ... e-game-666

Try out Pixel Golf on the Scirra Arcade!
https://www.scirra.com/arcade/sports-ga ... el-golf-67

Pudgy Platypus Games website!
www.pudgyplatypus.com
B
59
S
20
G
5
Posts: 212
Reputation: 7,390

Post » Tue Jan 20, 2015 3:47 pm

Use sin() to get the Y component.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Tue Jan 20, 2015 5:30 pm

Ha! That's amazing, I will try that! I fell asleep a lot in my Trigonometry class...
Twitter: https://twitter.com/pudgyplatypus

Learn to make a clicker game for cheap!
https://www.scirra.com/store/games-with ... e-game-666

Try out Pixel Golf on the Scirra Arcade!
https://www.scirra.com/arcade/sports-ga ... el-golf-67

Pudgy Platypus Games website!
www.pudgyplatypus.com
B
59
S
20
G
5
Posts: 212
Reputation: 7,390

Post » Wed Jan 21, 2015 8:14 am

lel, when you said "circle math" I thought about eating some pi. A nice apple pi would be so rad.
B
9
S
2
Posts: 80
Reputation: 854


Return to How do I....?

Who is online

Users browsing this forum: David181, Shenkai the ssj and 22 guests