@c gsplane.texi
  
@c This file is part of the 3DLDF User and Reference Manual.
@c Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The Free Software Foundation 
@c See the section "GNU Free Documentation License" in the file 
@c fdl.texi for copying conditions.


@node Plane Figures, Solid Figures, Paths, Top
@chapter Plane Figures

@tindex Circle
@tindex Ellipse
@tindex Polygon 
@tindex Rectangle
@tindex Reg_Cl_Plane_Curve 
@tindex Reg_Polygon
@c
3DLDF currently includes the following classes representing plane
geometric figures:  @code{Polygon}, @code{Reg_Cl_Plane_Curve} 
(``Regular Closed Plane Curve''), @code{Reg_Polygon} (``Regular
Polygon''), @code{Rectangle}, @code{Ellipse} and 
@code{Circle}.  @code{Polygon} and @code{Reg_Cl_Plane_Curve} are derived
from @code{Path}, @code{Reg_Polygon} and @code{Rectangle} are derived
from @code{Polygon}, and @code{Ellipse} and @code{Circle} are derived
from @code{Reg_Cl_Plane_Curve}.  @code{Polygon} and
@code{Reg_Cl_Plane_Curve} are meant to be used as base classes only, so
objects of these types should normally never be declared.

Since @code{Reg_Polygon}, @code{Rectangle}, @code{Ellipse}, and
@code{Circle} all ultimately derive from @code{Path}, they are really
just special kinds of @code{Path}.  
In particular, they inherit their drawing and filling functions from
@code{Path}, and their transformation functions take the same arguments
as the @code{Path} versions.
They also have constructors
and setting functions that work in a similar way, with a few minor
differences, to account for their different natures.  
See @ref{Polygon Reference}, @ref{Rectangle Reference}, 
@ref{Ellipse Reference}, and @ref{Circle Reference}, for complete
information on these classes. 

@menu
* Regular Polygons Getstart::   
* Rectangles Getstart::         
* Ellipses Getstart::           
* Circles Getstart::            
@end menu

 

@node Regular Polygons Getstart, Rectangles Getstart, Plane Figures, Plane Figures
@section Regular Polygons

The following example creates a pentagon in the x-z plane, centered
about the origin, whose enclosing circle has a radius equal to 3cm.

@example
default_focus.set(2, 3, -10, 2, 3, 10, 10);
Reg_Polygon p(origin, 5, 3);
p.draw();
@end example

@iftex
@tex 
\ifmakeexamples
\BEX
\BGRP 
\immediate\write\examples{default_focus.set(2, 3, -10, 2, 3, 10, 10);} 
\immediate\write\examples{Reg_Polygon p(origin, 5, 3);}
\immediate\write\examples{p.draw();}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "rt", gray, }
\immediate\write\examples{"", "", origin, origin, shift_z);}
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF20.png"
alt="[Figure 20. Not displayed.]"
/>
<br>
<br>
Fig. 20.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 20 not displayed.]
@end ifinfo

Three additional arguments cause the pentagon to be rotated about the x,
y, and z axes by the amount indicated.  In this example, it's rotated 
@DEG{90} 
about the x-axis, so that it comes to lie in the x-y plane:

@example
Reg_Polygon p(origin, 5, 3, 90);
p.draw();
@end example

@iftex
@tex 
\ifmakeexamples
\BEX
\BGRP 
\immediate\write\examples{Reg_Polygon p(origin, 5, 3, 90);}
\immediate\write\examples{p.draw();}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "d", gray, "",
"", origin, origin, shift_z);}
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF21.png"
alt="[Figure 21. Not displayed.]"
/>
<br>
<br>
Fig. 21.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 21 not displayed.]
@end ifinfo

In this example, it's rotated 
@DEG{36}
about the y-axis, so that it appears to point in the opposite
direction from the first example:
@example
Reg_Polygon p(origin, 5, 3, 0, 36);
p.draw();
@end example


@iftex
@tex 
\ifmakeexamples
\BEX
\BGRP 
\immediate\write\examples{Reg_Polygon p(origin, 5, 3, 0, 36);}
\immediate\write\examples{p.draw();}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "rt", gray, "",
"", origin, origin, shift_z);} 
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF22.png"
alt="[Figure 22. Not displayed.]"
/>
<br>
<br>
Fig. 22.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 22 not displayed.]
@end ifinfo

In this example, it's rotated 
@DEG{90}
about the z-axis, so that it lies in the z-y plane:

@example
Reg_Polygon p(origin, 5, 3, 0, 0, 90);
p.draw(); 
@end example



@iftex
@tex 
\ifmakeexamples
\BEX
\BGRP 
\immediate\write\examples{Reg_Polygon p(origin, 5, 3, 0, 0, 90);}
\immediate\write\examples{p.draw(); }
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "rt", gray, "",
"", origin, origin, shift_z);} 
\OEX{} 
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF23.png"
alt="[Figure 23. Not displayed.]"
/>
<br>
<br>
Fig. 23.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 23 not displayed.]
@end ifinfo

In this example, it's rotated 
@DEG{45}
about the x, y, and z-axes in that order:

@example
Reg_Polygon p(origin, 5, 3, 45, 45, 45);
p.draw(); 
@end example


@iftex
@tex 
\ifmakeexamples
\BEX
\BGRP 
\immediate\write\examples{Reg_Polygon p(origin, 5, 3, 45, 45, 45);}
\immediate\write\examples{p.draw(); }
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "d", gray, "",
"", origin, origin, shift_z);} 
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF24.png"
alt="[Figure 24. Not displayed.]"
/>
<br>
<br>
Fig. 24.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 24 not displayed.]
@end ifinfo

@code{Reg_Polygons} need not be centered about the @code{origin}.  If
another @code{Point} @var{pt} is used as the first argument, the @code{Reg_Polygon}
is first created with its center at the origin, then the specified
rotations, if any, are performed.  Finally, the @code{Reg_Polygon} is
shifted such that its center comes to lie on @var{pt}:

@example
Point P(-2, 1, 1);
Reg_Polygon hex(P, 6, 4, 60, 30, 30);
hex.draw(); 
@end example
 
@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Point P(-2, 1, 1);}
\immediate\write\examples{P.dotlabel("P"); }
\immediate\write\examples{Reg_Polygon hex(P, 6, 4, 60, 30, 30);}
\immediate\write\examples{hex.draw(); }
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "d", gray, "",
"", origin, origin, shift_z);}
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF25.png"
alt="[Figure 25. Not displayed.]"
/>
<br>
<br>
Fig. 25.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 25 not displayed.]
@end ifinfo

In the following example, the @code{Reg_Polygon} @code{polygon} is first
declared using the default constructor, which creates an empty
@code{Reg_Polygon}.  Then, the @code{polygon} is repeatedly changed using
the setting function corresponding to the constructor used in the
previous examples.  @NEXTFIG{} demonstrates that a given
@code{Reg_Polygon} need not always have the same number of sides.

@example
@group 
Point p(0, -3);
Reg_Polygon polygon;
for (int i = 3; i < 9; ++i)
  @OCB
    polygon.set(p, i, 3);
    polygon.draw();
    p.shift(0, 1);
  @CCB
@end group
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Point p(0, -3);}
\immediate\write\examples{Reg_Polygon polygon;}
\immediate\write\examples{for (int i = 3; i < 9; ++i)\OCB}
\immediate\write\examples{polygon.set(p, i, 3);}
\immediate\write\examples{polygon.draw();}
\immediate\write\examples{p.shift(0, 1);\CCB}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "rt", gray, "",
"", origin, origin, shift_z);} 
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF26.png"
alt="[Figure 26. Not displayed.]"
/>
<br>
<br>
Fig. 26.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 26 not displayed.]
@end ifinfo

@node Rectangles Getstart, Ellipses Getstart, Regular Polygons Getstart, Plane Figures
@section Rectangles

A @code{Rectangle} can be constructed in the x-z plane by specifying a 
center @code{Point}, the width, and the height:

@example
Rectangle r(origin, 2, 3);
r.draw();
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Rectangle r(origin, 2, 3);}
\immediate\write\examples{r.draw();}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "rt", gray, "",
                                    "", origin, origin, shift_z);} 
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF27.png"
alt="[Figure 27. Not displayed.]"
/>
<br>
<br>
Fig. 27.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 27 not displayed.]
@end ifinfo

Three additional arguments can be used to specify rotation about the x,
y, and z-axes respectively:

@example
Rectangle r(origin, 2, 3, 30, 45, 15);
r.draw();
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Rectangle r(origin, 2, 3, 30, 45, 15);}
\immediate\write\examples{r.draw();}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "d", gray, "",
"", origin, origin, shift_z);} 
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF28.png"
alt="[Figure 28. Not displayed.]"
/>
<br>
<br>
Fig. 28.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 28 not displayed.]
@end ifinfo

If a @code{Point} @var{p} other than the origin is specified as the center of
the @code{Rectangle}, the latter is first created in the x-z plane,
centered about the origin, as above.  Then, any rotations specified are
performed.  Finally, the @code{Rectangle} is shifted such that its center
comes to lie at @var{p}:

@example
Point p0(.5, 1, 3);
Rectangle r(p0, 4, 2, 30, 30, 30);
r.draw();
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP 
\immediate\write\examples{Point p0(.5, 1, 3);}
\immediate\write\examples{p0.dotlabel("$p_0$");} 
\immediate\write\examples{Point pt1(p0);}
\immediate\write\examples{pt1.shift(2);}
\immediate\write\examples{pt1.label("$p_0 = (0.5, 1, 3)$", "rt");}
\immediate\write\examples{Rectangle r(p0, 4, 2, 30, 30, 30);}
\immediate\write\examples{r.draw();}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "d", gray, "",
"", origin, origin, shift_z);} 
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF29.png"
alt="[Figure 29. Not displayed.]"
/>
<br>
<br>
Fig. 29.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 29 not displayed.]
@end ifinfo

This constructor has a corresponding setting function:

@example
Rectangle r;  
for (int i = 0; i < 180; i += 30)
  @OCB
    r.set(origin, 4, 2, i);
    r.draw();
  @CCB
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{default_focus.set(5, 3, -10, 5, 3, 10, 10);}
\immediate\write\examples{Rectangle r;  }
\immediate\write\examples{for (int i = 0; i < 180; i += 30)\OCB}
\immediate\write\examples{r.set(origin, 4, 2, i);}
\immediate\write\examples{ r.draw();\CCB}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(3, "d", "d", "d", gray, "",
"", origin, origin, shift_z);} 
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF30.png"
alt="[Figure 30. Not displayed.]"
/>
<br>
<br>
Fig. 30.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 30 not displayed.]
@end ifinfo

@code{Rectangles} can also be specified using four @code{Points} as
arguments, whereby they must be ordered so that they are contiguous in
the resulting @code{Rectangle}:

@example
Point pt[4];
pt[0].shift(-1, -2);
pt[2] = pt[1] = pt[0];
pt[1].rotate(180);
pt[3] = pt[1];
pt[2] *= pt[3].rotate(0, 180);
Rectangle r(pt[0], pt[2], pt[3], pt[1]);
r.draw();
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Point pt[4];}
\immediate\write\examples{pt[0].shift(-1, -2);}
\immediate\write\examples{pt[2] = pt[1] = pt[0];}
\immediate\write\examples{pt[1].rotate(180);}
\immediate\write\examples{pt[3] = pt[1];}
\immediate\write\examples{pt[2] *= pt[3].rotate(0, 180);}
\immediate\write\examples{Rectangle r(pt[0], pt[2], pt[3], pt[1]);}
\immediate\write\examples{r.draw();}
\immediate\write\examples{r.get_point(0).dotlabel(Point::WORLD_VALUES_X_Y, "llft");}
\immediate\write\examples{r.get_point(1).dotlabel(Point::WORLD_VALUES_X_Y, "lrt"); }
\immediate\write\examples{r.get_point(2).dotlabel(Point::WORLD_VALUES_X_Y, "urt"); }
\immediate\write\examples{r.get_point(3).dotlabel(Point::WORLD_VALUES_X_Y, "ulft"); }
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "", gray, "",
"", origin, origin, shift_z);} 
\OEX{Projections::PARALLEL_X_Y}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF31.png"
alt="[Figure 31. Not displayed.]"
/>
<br>
<br>
Fig. 31.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 31 not displayed.]
@end ifinfo

This constructor checks whether the @code{Point} arguments are coplanar,
however, it does not check whether they are really the corners of a
valid rectangle;  the user, or the code that calls this function, must
ensure that they are.  In the following 
example, @code{r}, although not rectangular, is a @code{Rectangle}, as
far as 3DLDF is concerned: 

@example
pt[0].shift(0, -1);
pt[3].shift(0, 1);
Rectangle q(pt[0], pt[2], pt[3], pt[1]);
q.draw();
@end example

@iftex
@tex 
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Point pt[4];}
\immediate\write\examples{pt[0].shift(-1, -2);}
\immediate\write\examples{pt[2] = pt[1] = pt[0];}
\immediate\write\examples{pt[1].rotate(180);}
\immediate\write\examples{pt[3] = pt[1];}
\immediate\write\examples{pt[2] *= pt[3].rotate(0, 180);}
\immediate\write\examples{pt[0].shift(0, -1);}
\immediate\write\examples{pt[3].shift(0, 1);}
\immediate\write\examples{Rectangle r(pt[0], pt[2], pt[3], pt[1]);}
\immediate\write\examples{r.draw();}
\immediate\write\examples{r.get_point(0).dotlabel(Point::WORLD_VALUES_X_Y, "llft");}
\immediate\write\examples{r.get_point(1).dotlabel(Point::WORLD_VALUES_X_Y, "lrt"); }
\immediate\write\examples{r.get_point(2).dotlabel(Point::WORLD_VALUES_X_Y, "urt"); }
\immediate\write\examples{r.get_point(3).dotlabel(Point::WORLD_VALUES_X_Y, "ulft"); }
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "ulft", "", 
gray, "", "", origin, origin, shift_z);}
\OEX{Projections::PARALLEL_X_Y}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF32.png"
alt="[Figure 32. Not displayed.]"
/>
<br>
<br>
Fig. 32.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 32 not displayed.]
@end ifinfo

This constructor is not really intended to be used directly, but should
mostly be called from within other functions, that should ensure that
the arguments produce a rectangular @code{Rectangle}.  There is also no
guarantee that transformations or other functions called on
@code{Rectangle}, @code{Circle}, or other classes representing
geometric figures won't cause them to become non-rectangular,
non-circular, or otherwise irregular.  Sometimes, this might even be
desirable.  I plan to add the function 
@code{Rectangle::is_rectangular()} soon, so that users can test 
@code{Rectangles} for rectangularity. 

@node Ellipses Getstart, Circles Getstart, Rectangles Getstart, Plane Figures
@section Ellipses

@code{Ellipse} has a constructor similar to those for
@code{Reg_Polygon} and @code{Rectangle}.  The first argument is the
center of the @code{Ellipse}, and the following two specify the lengths
of the horizontal and vertical axes respectively.  The @code{Ellipse} is
first created in the x-z plane, centered about the origin.  The
horizontal axis lies along the x-axis and the vertical axis lies along
the z-axis.  The three subsequent arguments specify the amounts of
rotation about the x, y, and z-axes respectively and default to 0.  
Finally,
@code{Ellipse} is shifted such that its center comes to lie at the
@code{Point} specified in the first argument.

@example
Point pt(-1, 1, 1);
Ellipse e(pt, 3, 6, 90);
e.draw();
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Point pt(-1, 1, 1);}
\immediate\write\examples{pt.dotlabel(Point::WORLD_VALUES, "bot"); }
\immediate\write\examples{Ellipse e(pt, 3, 6, 90);}
\immediate\write\examples{e.draw();}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "", gray, "");}
\OEX{PARALLEL_X_Y}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF33.png"
alt="[Figure 33. Not displayed.]"
/>
<br>
<br>
Fig. 33.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 33 not displayed.]
@end ifinfo

As you may expect, this constructor has a corresponding setting
function:

@c !! TO DO: Simplify this example.  LDF 2003.08.15.
@c
@example
Ellipse e;
real h_save = 1.5;
real v_save = 2;
real h = h_save;
real v = v_save;
Point p(-1);
for (int i = 0; i < 5; ++i)
  @OCB
      e.set(p, h, v, 90);
      e.draw();
      h_save += .25;
      v_save += .25;
      h *= sqrt(h_save);
      v *= sqrt(v_save);
      p.shift(0, 0, 2);
  @CCB
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Ellipse e;}
\immediate\write\examples{real h_save = 1.5;}
\immediate\write\examples{real v_save = 2;}
\immediate\write\examples{real h = h_save;}
\immediate\write\examples{real v = v_save;}
\immediate\write\examples{Point p(-1);}
\immediate\write\examples{for (int i = 0; i < 5; ++i)\OCB}
\immediate\write\examples{e.set(p, h, v, 90);}
\immediate\write\examples{e.draw();}
\immediate\write\examples{h_save += .25;}
\immediate\write\examples{v_save += .25;}
\immediate\write\examples{h *= sqrt(h_save);}
\immediate\write\examples{v *= sqrt(v_save);}
\immediate\write\examples{p.shift(0, 0, 2);\CCB}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "d", "d", "d", gray, "",
"", origin, origin, shift_z);} 
\OEX{}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF34.png"
alt="[Figure 34. Not displayed.]"
/>
<br>
<br>
Fig. 34.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 34 not displayed.]
@end ifinfo

@node Circles Getstart,  , Ellipses Getstart, Plane Figures
@section Circles

@code{Circles} are constructed just like @code{Ellipses}, except that
the vertical and horizontal axes are per definition the same, so
there's only one argument for the diameter, instead of two for the
horizontal and vertical axes:

@example
Point P(0, 2, 1);
Circle c(P, 3.5, 90, 90);
c.draw();
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{Point P(0, 2, 1);}
\immediate\write\examples{P.dotlabel(Point::WORLD_VALUES); }
\immediate\write\examples{Circle c(P, 3.5, 90, 90);}
\immediate\write\examples{c.draw();}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(0, "", "lft", "bot", gray, "");}
\OEX{PARALLEL_Z_Y}
\EGRP
\EEX 1
\fi
\PEX
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF35.png"
alt="[Figure 35. Not displayed.]"
/>
<br>
<br>
Fig. 35.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 35 not displayed.]
@end ifinfo

This constructor, too, has a corresponding setting function:  

@example
Circle c;
Point p(-1, 0, 5);
for (int i = 0; i < 16; ++i)
  @OCB
      c.set(p, 5, i * 22.5, 0, 0, 64);
      c.draw();
  @CCB
@end example

@iftex
@tex
\ifmakeexamples
\BEX
\BGRP
\immediate\write\examples{default_focus.set(2, 5, -10, 2, 5, 10, 10);}
\immediate\write\examples{Circle c;}
\immediate\write\examples{Point p(0, 0, 1);}
\immediate\write\examples{p.dotlabel("p", "bot");}
\immediate\write\examples{for (int i = 0; i < 16; ++i)\OCB}
\immediate\write\examples{c.set(p, 5, i * 22.5, 0, 0, 64);}
\immediate\write\examples{c.draw();\CCB}
\immediate\write\examples{Point shift_z(0, -.1);}
\immediate\write\examples{draw_axes(3.5, "d", "d", "d", gray, "", 
   "", origin, origin, shift_z);}
\OEX{}
\EGRP
\EEX 1
\fi
\PEX    
@end tex
@end iftex

@ifhtml
@html
<p align="center">
<br>
<img src="./graphics/png/3DLDF36.png"
alt="[Figure 36. Not displayed.]"
/>
<br>
<br>
Fig. 36.
<br>
</p>
@end html
@end ifhtml

@ifinfo
[Figure 36 not displayed.]
@end ifinfo

In the preceding example, the last argument to @code{set()}, namely ``64'',
is for the number of @code{Points} used for constructing the perimeter
of the @code{Circle}.  The default value is 16, however, if it is used,
foreshortening distorts the most nearly horizontal @code{Circle}.
Increasing the number of points used improves its appearance.  However,
there may be a limit to how much improvement is possible.
@xref{Accuracy}.  


