[Cuis-dev] Understanding Arc

Hilaire Fernandes hilaire at drgeo.eu
Tue May 4 12:18:21 PDT 2021


Hi Juan,

In DrGeo, the user can define an arc passing though three points (there 
is other way). With Vector Graphics primitive, there is this largeFlag 
attribute, depending on its value and the position of the three user 
defined points, the arc will do or not as expected.

Bellow the arc does not do as expected, when largeFlag is false. if I 
toggle largeFlag to true, then the arc goes through the three points.

The arc does not pass by the third point

However it will not work the other way, when the second point is moved 
close to the other points. I don't understand how should the largeFlag 
attribute be set.

The DrGeo's arc model knows about its center, radius, starting angle, 
and its oriented angle. Its polymoprhic pointAt: method gives the 
coordinates of any point on its line, with curvilinear abscissa between 
0 and 1.

drawOn: canvas
     | start end r orientation |
     start _ self drawable worldToMorph: (mathItem pointAt: 0).
     end  _ self drawable worldToMorph: (mathItem pointAt: 1).
     r _ self drawable worldToPixel: mathItem radius.
     orientation _ mathItem length negative.
     canvas strokeWidth: borderWidth color: borderColor do: [
         canvas moveToX: start x y: start y;
         arcToX: end x y: end y rx: r  ry: r angleOfXAxis: 0 largeFlag: false sweepFlag: orientation]


-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210504/daa31cbb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d??cran de 2021-05-04 21-03-47.png
Type: image/png
Size: 2871 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210504/daa31cbb/attachment.png>


More information about the Cuis-dev mailing list