Class Cylindrical3D
java.lang.Object
org.jlab.geom.prim.Cylindrical3D
- All Implemented Interfaces:
Face3D, Transformable, Showable
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newCylindrical3Dsuch that the arc of the surface is centered around the z axis, the radius is one, the arc begins at x=1 y=0 and ends at x=0, y=1, and the arc has unit height such that it extends from z=0 to z=1.Cylindrical3D(Arc3D arc, double height) Constructs a newCylindrical3Dfrom the given arc and height.Cylindrical3D(Cylindrical3D cylindricalSeg) Constructs a newCylindrical3Dthat is identical to the given cylindrical segment. -
Method Summary
Modifier and TypeMethodDescriptionbaseArc()Returns the base of this cylindrical segment.voidcopy(Cylindrical3D cylindricalSeg) Sets the core parameters of this cylindrical segment such that this surface becomes identical to the given surface.doubledistanceToEdge(Point3D point) Distance between the point and the closest cylinder edgegetAxis()returns the axis of this cylinder.doubleheight()Returns the height of this cylindrical segment.highArc()Constructs the arc at the top of this cylindrical segment.intintersection(Line3D line, List<Point3D> intersections) Finds the intersections of the given infinite line with thisFace3D.doubleintersectionLength(Line3D line, List<Point3D> intersections) Compute the intersections of a ray within the 3D volumeintintersectionRay(Line3D line, List<Point3D> intersections) Finds the intersections of the given ray with thisFace3D.intintersectionSegment(Line3D line, List<Point3D> intersections) Finds the intersections of the given line segment with thisFace3D.booleanisOnSurface(Point3D point) Returns true if the given point is on the surface of this cylindrical segment.point(int index) Returns the point from thisFace3Dwith corresponding index.voidrotateX(double angle) Rotates this object clockwise around the x axis.voidrotateY(double angle) Rotates this object clockwise around the y axis.voidrotateZ(double angle) Rotates this object clockwise around the z axis.voidSets the parameters of this cylindrical segment to equal the given parameters.voidSets the base of this cylindrical segment.voidSets the axis of this cylinder.voidsetHeight(double height) Sets the height of this cylindrical segment.voidshow()InvokesSystem.out.println(this).toString()voidtranslateXYZ(double dx, double dy, double dz) Translates this object linearly by the amounts specified.
-
Constructor Details
-
Cylindrical3D
public Cylindrical3D()Constructs a newCylindrical3Dsuch that the arc of the surface is centered around the z axis, the radius is one, the arc begins at x=1 y=0 and ends at x=0, y=1, and the arc has unit height such that it extends from z=0 to z=1. -
Cylindrical3D
Constructs a newCylindrical3Dfrom the given arc and height.- Parameters:
arc- the base of the cylindrical segmentheight- the height
-
Cylindrical3D
Constructs a newCylindrical3Dthat is identical to the given cylindrical segment.- Parameters:
cylindricalSeg- the cylindrical segment to copy
-
-
Method Details
-
copy
Sets the core parameters of this cylindrical segment such that this surface becomes identical to the given surface.- Parameters:
cylindricalSeg- the cylindrical segment to copy
-
set
Sets the parameters of this cylindrical segment to equal the given parameters.- Parameters:
arc- the base of the cylindrical segmentheight- the height
-
setArc
Sets the base of this cylindrical segment.- Parameters:
arc- the base of the cylindrical segment
-
setAxis
Sets the axis of this cylinder.- Parameters:
axis- the base of the cylindrical segment
-
getAxis
returns the axis of this cylinder.- Returns:
- the axis of the cylindrical segment
-
setHeight
public void setHeight(double height) Sets the height of this cylindrical segment.- Parameters:
height- the height
-
baseArc
Returns the base of this cylindrical segment.- Returns:
- the base of this cylindrical segment
-
highArc
Constructs the arc at the top of this cylindrical segment.- Returns:
- the arc at the top of this cylindrical segment
-
height
public double height()Returns the height of this cylindrical segment.- Returns:
- the height of this cylindrical segment.
-
intersection
Description copied from interface:Face3DFinds the intersections of the given infinite line with thisFace3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.- Specified by:
intersectionin interfaceFace3D- Parameters:
line- the infinite lineintersections- the list to store the intersections in- Returns:
- the number of intersections found
-
intersectionRay
Description copied from interface:Face3DFinds the intersections of the given ray with thisFace3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.- Specified by:
intersectionRayin interfaceFace3D- Parameters:
line- the rayintersections- the list to store the intersections in- Returns:
- the number of intersections found
-
intersectionSegment
Description copied from interface:Face3DFinds the intersections of the given line segment with thisFace3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.- Specified by:
intersectionSegmentin interfaceFace3D- Parameters:
line- the line segmentintersections- the list to store the intersections in- Returns:
- the number of intersections found
-
intersectionLength
-
isOnSurface
Returns true if the given point is on the surface of this cylindrical segment.- Parameters:
point- the point- Returns:
- true if the point is on the surface
-
distanceToEdge
Distance between the point and the closest cylinder edge- Parameters:
point- the point- Returns:
- distance if point is on the surface, 0 otherwise
-
translateXYZ
public void translateXYZ(double dx, double dy, double dz) Description copied from interface:TransformableTranslates this object linearly by the amounts specified.- Specified by:
translateXYZin interfaceTransformable- Parameters:
dx- amount to translate along the x axisdy- amount to translate along the y axisdz- amount to translate along the z axis
-
rotateX
public void rotateX(double angle) Description copied from interface:TransformableRotates this object clockwise around the x axis.- Specified by:
rotateXin interfaceTransformable- Parameters:
angle- rotation angle in radians
-
rotateY
public void rotateY(double angle) Description copied from interface:TransformableRotates this object clockwise around the y axis.- Specified by:
rotateYin interfaceTransformable- Parameters:
angle- rotation angle in radians
-
rotateZ
public void rotateZ(double angle) Description copied from interface:TransformableRotates this object clockwise around the z axis.- Specified by:
rotateZin interfaceTransformable- Parameters:
angle- rotation angle in radians
-
show
-
toString
-
point
Description copied from interface:Face3DReturns the point from thisFace3Dwith corresponding index. If an invalid index is given, then null is returned.
-