Plot xy, coords to create a circle with centrepoint and radius

Dazz
Messages
2
Reaction score
0
Hey all,

I posted this in a thread with similar discussions but thought to make a new one. Skip to the last two sections if you're in a rush :)

About me
------------
I did maths in high school and stats in university but I can't work some (probably elementary) sin / cos / tan stuff out. I was hoping someone could assist me? Unfortunately, after years of circular neglect, my maths has fallen by the way side on this.

Setting the scene
--------------------
I am looking to write a PHP program to output coords for a circle. I intend to import these into Autocad via .scr file, initially to create the circle using the Atocad 3dpoly command, but later to modify the code to create things like 3d parallel spirals... and other interesting things Autocad doesn't like.

Current usage
----------------
The php code I have works somewhat, but not exactly how I want it. Converting the code into english... I can currently get an X coord by using the following logic (each term is described under the logic).

Offset + (r * cos(Angle * PI / 180))

Offset: A number to move my diagram into positive values in autocad
r: the radius of the circle
Angle: The angle, a value between 0 and 359
PI: the magic circle number (3.14ish)

I can also get the Y coord a similar way using sin

I use this formula, passing an angle of 0 through to 359, to create coords for a circle.

The problem
-------------
The above works fine and I can draw a circle by using the formula, increasing the angle and plotting the point.

What this doesn't do is allow me to shorten the radius for a second circle inside the first with a constant displacement. I believe it's because the technique above creates a circle using a common start point rather than a common centre point.

My Question
-------------
What logic should I use to plot a circle using a centre point so that the radius can be varied?

Thanks in advance for any help.

Darren
 
Mathematics news on Phys.org
Dazz said:
Hey all,

I posted this in a thread with similar discussions but thought to make a new one. Skip to the last two sections if you're in a rush :)

About me
------------
I did maths in high school and stats in university but I can't work some (probably elementary) sin / cos / tan stuff out. I was hoping someone could assist me? Unfortunately, after years of circular neglect, my maths has fallen by the way side on this.

Setting the scene
--------------------
I am looking to write a PHP program to output coords for a circle. I intend to import these into Autocad via .scr file, initially to create the circle using the Atocad 3dpoly command, but later to modify the code to create things like 3d parallel spirals... and other interesting things Autocad doesn't like.

Current usage
----------------
The php code I have works somewhat, but not exactly how I want it. Converting the code into english... I can currently get an X coord by using the following logic (each term is described under the logic).

Offset + (r * cos(Angle * PI / 180))

Offset: A number to move my diagram into positive values in autocad
r: the radius of the circle
Angle: The angle, a value between 0 and 359
PI: the magic circle number (3.14ish)

I can also get the Y coord a similar way using sin

I use this formula, passing an angle of 0 through to 359, to create coords for a circle.

The problem
-------------
The above works fine and I can draw a circle by using the formula, increasing the angle and plotting the point.

What this doesn't do is allow me to shorten the radius for a second circle inside the first with a constant displacement. I believe it's because the technique above creates a circle using a common start point rather than a common centre point.

My Question
-------------
What logic should I use to plot a circle using a centre point so that the radius can be varied?

Thanks in advance for any help.

Darren
Allow r to be a variable, of course. In what you have given "Offset" is the x-coordinate of the center of the circle, r is the radius.
 
Hmm... i see. Well if it's not the maths (phew) then autocad layers must be screwing with me.

Thanks for your time.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top