public class CylinderSector extends Model
By a partial cylinder we mean a cylinder over a circular sector of the cylinder's base.
Cylinder
lineSegmentList, vertexList, visible
Constructor and Description |
---|
CylinderSector()
Create half of a cylinder with radius 1
and its axis along the y-axis from
y = -1 to y = 1 . |
CylinderSector(double r,
double h1,
double h2,
double theta1,
double theta2,
int n,
int k)
Create a part of the cylinder with radius
r and its
axis along the y-axis from y = -h1 to y = h1 . |
CylinderSector(double r,
double h,
double theta1,
double theta2,
int n,
int k)
Create a part of the cylinder with radius
r and its
axis along the y-axis from y = -h to y = h . |
addLineSegment, addLineSegment, addVertex, setColor, setColorRandom, setRandomColors, setRandomLineSegmentColors, toString
public CylinderSector()
y = -1
to y = 1
.public CylinderSector(double r, double h1, double h2, double theta1, double theta2, int n, int k)
r
and its
axis along the y-axis from y = -h1
to y = h1
.
If theta1 > 0
or theta2 < 2*PI
,then the partial
cylinder is a cylinder over the circular sector from angle
theta1
to angle theta2
. In other words, the
(partial) circles of latitude in the model extend from angle
theta1
to angle theta2
.
The last two parameters determine the number of lines of longitude and the number of (partial) circles of latitude in the model.
Notice that if there are n
circles of latitude in the model,
then each line of longitude will have n-1
line segments.
If there are k
lines of longitude, then each (partial)
circle of latitude will have k-1
line segments.
There must be at least four lines of longitude and at least two circles of latitude.
r
- radius of the cylinderh1
- height (on the y-axis) of the base of the cylinderh2
- height (on the y-axis) of the top of the cylindertheta1
- beginning longitude angle of the sectortheta2
- ending longitude angle of the sectorn
- number of circles of latitude around the cylinderk
- number lines of longitudepublic CylinderSector(double r, double h, double theta1, double theta2, int n, int k)
r
and its
axis along the y-axis from y = -h
to y = h
.
The partial cylinder is a cylinder over the circular sector
from angle theta1
to angle theta2
.
The last two parameters determine the number of lines of longitude and the number of (partial) circles of latitude in the model.
Notice that if there are n
circles of latitude in the model,
then each line of longitude will have n-1
line segments.
If there are k
lines of longitude, then each (partial)
circle of latitude will have k-1
line segments.
There must be at least four lines of longitude and at least two circles of latitude.
r
- radius of the cylinderh
- height of the cylindertheta1
- beginning longitude angle of the sectortheta2
- ending longitude angle of the sectorn
- number of circles of latitude around the cylinderk
- number lines of longitude