HP Prime - Drawing a circle from a program



#8

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.


#9

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


#10

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}.

#11

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.


#12

elle n'existe pas, tu dois utiliser ARC_P


#13

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.

#14

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

TW


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sending little images to the Prime (...and Program name bug?) Erwin Ried 19 7,457 12-10-2013, 05:35 PM
Last Post: Erwin Ried
  HP Prime Tutorial #6 and #7: Drawing Eddie W. Shore 2 1,930 12-10-2013, 08:16 AM
Last Post: Eddie W. Shore
  Problem with debug HP prime program, somebody help me? Carlos CM (Mexico) 6 3,364 12-05-2013, 03:07 PM
Last Post: Carlos CM (Mexico)
  HP PRIME: APP program code DISAPPEARS !! Joseph Ec 0 1,217 11-25-2013, 11:35 AM
Last Post: Joseph Ec
  Prime: Placing more than 1 item on the RPN stack in a single program? John Colvin 4 2,274 11-19-2013, 08:59 AM
Last Post: Miguel Toro
  Prime: Program size limited to 64K? Erwin Ried 4 2,056 11-17-2013, 11:42 PM
Last Post: Joseph Ec
  [HP-Prime] Picking elements from a List in a program Jean-Michel 3 2,024 11-15-2013, 04:16 AM
Last Post: dg1969
  HP Prime: Recommendation for future RPN Program Mode BruceTTT 3 2,169 11-13-2013, 10:03 PM
Last Post: BruceTTT
  Converting Great Circle Navigation from 41C to 42S Bill Triplett 11 3,506 11-13-2013, 07:24 AM
Last Post: Kimberly Thompson
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,733 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira

Forum Jump: