RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
A little help with circles.

0 Members and 1 Guest are viewing this topic.

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
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.

Code: [Select]
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.
« Last Edit: September 20, 2006, 01:23:42 AM by Tsunokiette »
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
r - radius
x - coordinate on the x-axis
y - coordinate on the y-axis
fi - angle (in radians)

x = r * Math.cos(fi)
y = r * Math.sin(fi)

Don´t forget to set offset of the "zero-zero" point.
i.e. offset_x = offset_y = r

In that case you need to use something like

x_coord = offset_x - x
y_coord = offset_y - y
« Last Edit: September 20, 2006, 11:31:27 AM by Blizzard »
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
Thanks, I guess my problem now is understanding what Radians are. I've heard of them, but while I'm in the top percentile of my class, I don't know everything lol.

PS: Holy Cr*p, That's amazing. *refering to pm* Gah, having urge to finish highschool and go to college already.
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
I´m glad you like the file, lol.
Radians are similar to degrees. But instead of i.e. 180 degrees you have 1 * PI. 360 is 2 * PI, while i.e. 45 degrees is PI/4 in radians. It´s not REALLY complex, it just seems so.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!