cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

7-Bedrock

## Prime 8.0 How can I plot a circle

How can I plot a circle in the X-Y plane, only knowing the radius and location of the circle center?

ACCEPTED SOLUTION

Accepted Solutions
19-Tanzanite
(To:Snowshoe_Bob)
27 REPLIES 27
19-Tanzanite
(To:Snowshoe_Bob)

7-Bedrock
(To:Snowshoe_Bob)

Thank you!  That was easy.

7-Bedrock
(To:Snowshoe_Bob)

One more request.  Is there a way to modify the above where there is a circle intercept at (0,0) ?

25-Diamond I
(To:Snowshoe_Bob)

@Snowshoe_Bob wrote:

One more request.  Is there a way to modify the above where there is a circle intercept at (0,0) ?

I am not sure what you mean. If you know the center of the circle and if you demand that (0,0) should be a point of the circles circumference, you sure are able to calculate the circle radius and so can use the very same approach which was shown to you.

Here is a circle function I often use when I have to draw a circle.

You may use it to draw partial circles

to draw regular polygons

or to play around and create mandala like pics

Prime 9 worksheet attached

7-Bedrock
(To:Werner_E)

Sorry.... I was not clear.  I mean that one point on the circle will be at (0,0) with a center in Quadrant 1 at a point (x,y).

25-Diamond I
(To:Snowshoe_Bob)

Yes, I had already suspected that and therefore suggested calculating the radius (as the distance between the two points, with Pythagoras, r= sqrt(x^2+y^2)) and then using the method already suggested or the function I posted to draw the circle.

7-Bedrock
(To:Werner_E)

Thank you!  I will try to plug in your equations.  I have Prime 8.0 so I could not use it directly.

7-Bedrock
(To:Werner_E)

This this bit of programming [NaN NaN} ?  Looks like the first trial bombed.  I am a novice at programming.  See attached.

20-Turquoise
(To:Snowshoe_Bob)

[NaN NaN] makes pen off for the plot line.

7-Bedrock
(To:ttokoro)

Thanks!!

25-Diamond I
(To:Snowshoe_Bob)

Hope this helps:

BTW, you sure can use 400 points to make the circle but you would be surprised that even much less points make up a quite good representation of a circle as well.

7-Bedrock
(To:Werner_E)

Thank you!  It works!

Bob

7-Bedrock
(To:Werner_E)

Werner,

Update:  If I resolve the point as a radius, then compare that radius to the radius of the circle, the problem is solved I believe.

In relationship the above math, is there a boolean or math routine to determine if a X-Y point is inside or outside the circle?  Can suggest a tack to take to solve this problem?

25-Diamond I
(To:Snowshoe_Bob)

@Snowshoe_Bob wrote:

Werner,

Update:  If I resolve the point as a radius, then compare that radius to the radius of the circle, the problem is solved I believe.

Which problem?

In relationship the above math, is there a boolean or math routine to determine if a X-Y point is inside or outside the circle?  Can suggest a tack to take to solve this problem?

Not sure what the problem is!?  A point is inside the circle if its distance from the circle center is less than the circle radius.

You may use a test function like this:

Playing around ...

Worksheet in Prime 6 format attached

7-Bedrock
(To:Werner_E)

I like what you did...  I would have handled it a bit more rudimentary.   But your solution is best.

Thanks!

23-Emerald III
(To:Werner_E)

For those limited to express, here is a set of functions to draw shapes:

And you can stack the result to create complex shapes, such as the CE mark:

Success!
Luc

7-Bedrock
(To:LucMeekes)

Thanks!

7-Bedrock
(To:LucMeekes)

This looks very handy!

20-Turquoise
(To:Snowshoe_Bob)

25-Diamond I
(To:ttokoro)

Nice, but why only circles parallel to the xy-plane?

25-Diamond I
(To:Werner_E)

Playing around with the inscribed circles of the surfaces of a dodecahedron

7-Bedrock
(To:Werner_E)

Nice!  Thank you.  Will work for future programming..

7-Bedrock
(To:Werner_E)

Very cool!  Thank you

20-Turquoise
(To:Werner_E)

Thanks show us not x-y plane plot. I try it.

25-Diamond I
(To:ttokoro)

20-Turquoise
(To:Werner_E)

Good eye!

7-Bedrock
(To:ttokoro)

Thank You!

Announcements

Top Tags