Class Sector3D

java.lang.Object
org.jlab.geom.prim.Sector3D
All Implemented Interfaces:
Face3D, Transformable, Showable

public final class Sector3D extends Object implements Face3D
A sector represented by an arc and a radial thickness. Sectors are regions of a plane bounded by two angles and two radii relative to some reference point.
Author:
jnhankins
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Constructs a new Sector3D such that the sector is bounded by two arcs such that the origin points of the inner and outer arcs begin at begin at (1, 0, 0) and (2, 0, 0) and end at (0, 1, 0) and (0, 2, 0) respectively.
    Sector3D(Arc3D outerArc, double dR)
    Constructs a new Sector3D from the given outer arc and the given radial thickness.
    Constructs a new Sector3D that is identical to the given sector.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    copy(Sector3D sector)
    Copies the parameters of the given sector so that this sector is identical to the given sector.
    double
    Computes the minimum distance of the given point from the edges of this Sector3D.
    Constructs the inner arc of this sector.
    double
    Returns the inner radius of this sector.
    int
    intersection(Line3D line, List<Point3D> intersections)
    Finds the intersections of the given infinite line with this Face3D.
    int
    intersectionRay(Line3D line, List<Point3D> intersections)
    Finds the intersections of the given ray with this Face3D.
    int
    intersectionSegment(Line3D line, List<Point3D> intersections)
    Finds the intersections of the given line segment with this Face3D.
    boolean
    Test whether the given point is inside the area of this Sector3D.
     
    Returns the outer arc of this sector.
    double
    Returns the outer radius of this sector.
     
    point(int index)
    Returns the point from this Face3D with corresponding index.
    double
    Returns the radial thickness of this sector, that is the positive difference between the inner and outer radii.
    void
    rotateX(double angle)
    Rotates this object clockwise around the x axis.
    void
    rotateY(double angle)
    Rotates this object clockwise around the y axis.
    void
    rotateZ(double angle)
    Rotates this object clockwise around the z axis.
    void
    set(Arc3D outerArc, double dR)
    Sets the outer arc of this sector and the radial thickness.
    void
    setInnerArc(Arc3D outerArc)
    Sets the outer arc of this sector.
    void
    setRadialThickness(double dR)
    Sets the radial thickness of this sector, that is the positive difference between the inner and outer radii.
    void
    Invokes System.out.println(this).
     
    void
    translateXYZ(double dx, double dy, double dz)
    Translates this object linearly by the amounts specified.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details Link icon

    • Sector3D Link icon

      public Sector3D()
      Constructs a new Sector3D such that the sector is bounded by two arcs such that the origin points of the inner and outer arcs begin at begin at (1, 0, 0) and (2, 0, 0) and end at (0, 1, 0) and (0, 2, 0) respectively.

      This sector is coplanar with the xy-plane. The inner and outer radius of this sector will differ by one unit. This sector has a coverage of 90 degrees.

    • Sector3D Link icon

      public Sector3D(Arc3D outerArc, double dR)
      Constructs a new Sector3D from the given outer arc and the given radial thickness.
      Parameters:
      outerArc - the outer arc
      dR - the radial thickness
    • Sector3D Link icon

      public Sector3D(Sector3D sector)
      Constructs a new Sector3D that is identical to the given sector.
      Parameters:
      sector - the sector to copy
  • Method Details Link icon

    • copy Link icon

      public void copy(Sector3D sector)
      Copies the parameters of the given sector so that this sector is identical to the given sector.
      Parameters:
      sector - the sector to copy
    • set Link icon

      public void set(Arc3D outerArc, double dR)
      Sets the outer arc of this sector and the radial thickness.
      Parameters:
      outerArc - the outer arc
      dR - the radial thickness
    • setInnerArc Link icon

      public void setInnerArc(Arc3D outerArc)
      Sets the outer arc of this sector.
      Parameters:
      outerArc - the outer arc
    • setRadialThickness Link icon

      public void setRadialThickness(double dR)
      Sets the radial thickness of this sector, that is the positive difference between the inner and outer radii.
      Parameters:
      dR - the radial thickness
    • outerArc Link icon

      public Arc3D outerArc()
      Returns the outer arc of this sector.
      Returns:
      the outer arc
    • innerArc Link icon

      public Arc3D innerArc()
      Constructs the inner arc of this sector.
      Returns:
      the inner arc.
    • radialThickness Link icon

      public double radialThickness()
      Returns the radial thickness of this sector, that is the positive difference between the inner and outer radii.
      Returns:
      the radial thickness
    • innerRadius Link icon

      public double innerRadius()
      Returns the inner radius of this sector.
      Returns:
      the inner radius
    • outerRadius Link icon

      public double outerRadius()
      Returns the outer radius of this sector.
      Returns:
      the outer radius
    • isInside Link icon

      public boolean isInside(Point3D p)
      Test whether the given point is inside the area of this Sector3D.
      Parameters:
      p - the given point
      Returns:
      true if inside or false if outside
    • distanceFromEdge Link icon

      public double distanceFromEdge(Point3D p)
      Computes the minimum distance of the given point from the edges of this Sector3D.
      Parameters:
      p - the given point
      Returns:
      the signed distance to the Sector3D edges, positive if inside or negative if outside
    • point Link icon

      public Point3D point(int index)
      Description copied from interface: Face3D
      Returns the point from this Face3D with corresponding index. If an invalid index is given, then null is returned.
      Specified by:
      point in interface Face3D
      Parameters:
      index - index of the point
      Returns:
      the point at the corresponding index, otherwise null
    • normal Link icon

      public Vector3D normal()
    • plane Link icon

      public Plane3D plane()
    • intersection Link icon

      public int intersection(Line3D line, List<Point3D> intersections)
      Description copied from interface: Face3D
      Finds the intersections of the given infinite line with this Face3D. 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:
      intersection in interface Face3D
      Parameters:
      line - the infinite line
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found
    • intersectionRay Link icon

      public int intersectionRay(Line3D line, List<Point3D> intersections)
      Description copied from interface: Face3D
      Finds the intersections of the given ray with this Face3D. 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:
      intersectionRay in interface Face3D
      Parameters:
      line - the ray
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found
    • intersectionSegment Link icon

      public int intersectionSegment(Line3D line, List<Point3D> intersections)
      Description copied from interface: Face3D
      Finds the intersections of the given line segment with this Face3D. 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:
      intersectionSegment in interface Face3D
      Parameters:
      line - the line segment
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found
    • translateXYZ Link icon

      public void translateXYZ(double dx, double dy, double dz)
      Description copied from interface: Transformable
      Translates this object linearly by the amounts specified.
      Specified by:
      translateXYZ in interface Transformable
      Parameters:
      dx - amount to translate along the x axis
      dy - amount to translate along the y axis
      dz - amount to translate along the z axis
    • rotateX Link icon

      public void rotateX(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the x axis.
      Specified by:
      rotateX in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • rotateY Link icon

      public void rotateY(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the y axis.
      Specified by:
      rotateY in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • rotateZ Link icon

      public void rotateZ(double angle)
      Description copied from interface: Transformable
      Rotates this object clockwise around the z axis.
      Specified by:
      rotateZ in interface Transformable
      Parameters:
      angle - rotation angle in radians
    • show Link icon

      public void show()
      Invokes System.out.println(this).
      Specified by:
      show in interface Showable
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object