The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP Prime - Drawing a circle from a program
Message #1 Posted by Jean-Michel on 6 Nov 2013, 4:41 p.m.

Hello

I can draw a line from a program:
line({0,0},{5,5});
But I cannot find the correct syntax to draw a circle by giving coordinates of the center and the radius. I tried all kind of syntaxes I could imagine with no success. Manual did not help me more.
Help much appreciated.
Kind regards.

      
Re: HP Prime - Drawing a circle from a program
Message #2 Posted by Thomas Chrapkiewicz on 6 Nov 2013, 4:52 p.m.,
in response to message #1 by Jean-Michel

ARC(G,x,y,r,a1,a2,c)

or

ARC_P (G,x,y,r,a1,a2,c)

Page 538 in Edition 1, July 2013, User Guide.

TomC

            
Re: HP Prime - Drawing a circle from a program
Message #3 Posted by Eddie W. Shore on 6 Nov 2013, 8:46 p.m.,
in response to message #2 by Thomas Chrapkiewicz

Note: radius (r) is always in pixels, regardless of whether ARC or ARC_P is used. So if you are using the Cartesian version of ARC, convert the radius first.

I recommend just using ARC_P and work with pixels. I believe the conversion formulas are:

X point to pixel: integer((x - Xmin)/(Xmax - Xmin)) * 318

Y point to pixel: integer((y - Ymax)/(Ymin -Ymax)) * 218

Also you can use the C>PX command in the catalog. C>PX(x,y) returns the list {x pixel, y pixel}.

            
Re: HP Prime - Drawing a circle from a program
Message #4 Posted by Jean-Michel on 7 Nov 2013, 2:49 a.m.,
in response to message #2 by Thomas Chrapkiewicz

Bonjour Thomas

Why does the command "circle()" not be used?
It was the command I was trying to use. I am confused. Many thanks for you answer. Kind regards.

                  
Re: HP Prime - Drawing a circle from a program
Message #5 Posted by Mic on 7 Nov 2013, 9:06 a.m.,
in response to message #4 by Jean-Michel

elle n'existe pas, tu dois utiliser ARC_P

                        
Re: HP Prime - Drawing a circle from a program
Message #6 Posted by Jean-Michel on 7 Nov 2013, 3:40 p.m.,
in response to message #5 by Mic

Mic

in fact, I was using the line() command of the Geometry App in a program, which works fine as soon as you use the following syntax:
line({x1,y1},{x2,y2})
But for an unknown reason, trying to use a similar syntax on the circle() command of the Geometry App in a program does not work. For instance, here is a syntax I tried:
circle({x1,y1},{x2,y2})
I thought this would draw a circle where x1,y1 and x2,y2 would be the coordinates of two end points of a diameter.

Kind regards.

                  
Re: HP Prime - Drawing a circle from a program
Message #7 Posted by Tim Wessman on 7 Nov 2013, 9:20 a.m.,
in response to message #4 by Jean-Michel

Because "circle" implies that you are drawing a complete circle exclusively. ARC can draw curved arcs between 0<x<2pi angular values.

TW


[ Return to Index | Top of Index ]

Go back to the main exhibit hall