1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <?xml-stylesheet type=
"text/xsl" href=
"formats/html.xsl"?>
4 <!-- This file is part of Shapes. -->
6 <!-- Shapes is free software: you can redistribute it and/or modify -->
7 <!-- it under the terms of the GNU General Public License as published by -->
8 <!-- the Free Software Foundation, either version 3 of the License, or -->
9 <!-- any later version. -->
11 <!-- Shapes is distributed in the hope that it will be useful, -->
12 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
13 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
14 <!-- GNU General Public License for more details. -->
16 <!-- You should have received a copy of the GNU General Public License -->
17 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
19 <!-- Copyright 2008, 2014, 2015 Henrik Tidefelt -->
23 <within-namespace>..Shapes..Geometry
</within-namespace>
24 <extension>circle
</extension>
26 <p>Functions for construction of circles and circular arcs in
<str-2D />.
</p>
31 <title><self /></title>
32 <meta-selflink><self-href /></meta-selflink>
33 <up-link><parent-namespace /></up-link>
34 <base href=
<!--#expand-next-string-->"$(BASE)" />
35 <examples-home href=
<!--#expand-next-string-->"$(EXAMPLES)" />
36 <shapes-version number=
<!--#expand-next-string-->"$(SHAPES_VERSION)" />
38 <!--#include virtual="^/toc.xml" -->
43 <p>It may very well be argued that these bindings should be provided by the core. Besides a wish to keep the core small (to ease maintenance), one reason not to include these in the core is to remind that constructing circular arcs in use code it really easy.
</p>
44 <p>It should be reminded that circular arcs can only be approximated using cubic splines, so there is no way to define a path perfectly following a circle.
</p>
49 <system-binding name=
"circle">
50 <summary>Circular path
</summary>
52 <case constructor-of=
"Path">
55 <type><named-type name=
"Length" /></type>
58 <dynamic-references></dynamic-references>
60 <p>Construct circle in
<str-2D /> space, of radius
<arg name=
"r" />, centered at the origin.
</p>
61 <p>The circle is approximated using four spline segments, and for positive radii, it encircles the origin counter-clockwise, starting on the positive x axis.
</p>
62 <p>Use
<value name=
"immerse" /> and
<value name=
"rotate3D" /> to take the circle into
<str-3D /> space.
</p>
68 <system-binding name=
"ccw_arc">
69 <summary>Couter-clockwise circular arc
</summary>
71 <case constructor-of=
"Path">
74 <type><named-type name=
"Coords" /></type>
76 <arg identifier=
"zStart">
77 <type><named-type name=
"Coords" /></type>
79 <arg identifier=
"zEnd">
80 <type><named-type name=
"Coords" /></type>
83 <type><named-type name=
"Length" /></type>
86 <dynamic-references></dynamic-references>
88 <p>Construct circular arc with counter-clockwise direction.
</p>
89 <p>The center point of the circle is
<arg name=
"z0" />, and the radius of the arc is
<arg name=
"r" />. The arc starts on the ray from
<arg name=
"z0" /> to
<arg name=
"zStart" />, and ends on the ray from
<arg name=
"z0" /> to
<arg name=
"zEnd" />.
</p>
90 <p>See also
<value name=
"..Shapes..Geometry..cw_arc" />.
</p>
96 <system-binding name=
"cw_arc">
97 <summary>Clockwise circular arc
</summary>
99 <case constructor-of=
"Path">
101 <arg identifier=
"z0">
102 <type><named-type name=
"Coords" /></type>
104 <arg identifier=
"zStart">
105 <type><named-type name=
"Coords" /></type>
107 <arg identifier=
"zEnd">
108 <type><named-type name=
"Coords" /></type>
111 <type><named-type name=
"Length" /></type>
114 <dynamic-references></dynamic-references>
116 <p>Like
<value name=
"..Shapes..Geometry..ccw_arc" />, but creates arcs with clockwise direction.
</p>