I know what Sine and Cosine are (mostly).
Sine = opposite / hypotonuse(sp?)
Cosine = adjacent /hypotonuse(sp?)
But since I have no clue how to apply that to circles, I used Seph's Ring Menu Customizable script as a reference.
Will the following have any chance of working as I hope it to? If it does, I'll use it for lots of stuff lol.
class Circle_Reference
def initialize(x,y,diameter)
@x = x
@y = y
@diameter = diameter
@radius = @diameter / 2
@circumference = (@diameter * Math::PI).floor
end
def find_point(percentage)
d1 = 2.0 * Math::PI / @circumference
d2 = d1 / @circumference
temp = @circumference * percentage.floor
for i in 0...@circumference
if i == temp
j = i - temp + 1
d = d1 * j + d2 * @steps
x = (@x + @radius) + ( @radius * Math.sin( d ) ).to_i
y = (@y + @radius) - ( @radius * Math.cos( d ) ).to_i
return [x,y]
end
end
end
end
EDIT : Let me rephrase this, how the heck do I do something like this? I just need to know the math portion, I'll figure the rest out. As I said before, all I need to know is how to find a point on a circle using Sine and Cosine.