Class Helix3D

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

public final class Helix3D extends Object implements Transformable, Showable
Author:
jnhankins
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Constructs a new Helix3D centered around the origin, with its origin point at (1, 0, 0), looping once clockwise up the y-axis and ending at (1, 1, 0).
    Creates a new Helix3D identical to the given helix.
    Helix3D(Point3D origin, Point3D center, Vector3D normal, double totalHeight, double loopHeight, boolean clockwise)
    Constructs a helix from the given parameters.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    Returns the central point of the helix.
    boolean
    Returns true if the helix spirals clockwise around its central axis.
    void
    copy(Helix3D helix)
    Copies the parameters of the given helix so this helix is is identical to the given helix.
    boolean
    Returns true if the point is on the helix (within 100nm).
    double
    Returns the distance between winds of the helix.
    Returns the direction vector of the central axis.
    Returns the origin point on the helix.
    point(double height)
    Returns the point on the helix at the specified height.
    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(Point3D origin, Point3D center, Vector3D normal, double totalHeight, double loopHeight, boolean clockwise)
    Sets the parameters of this helix.
    void
    Sets the center point of the helix.
    void
    setClockwise(boolean clockwise)
    Sets the clockwisedness of the loop.
    void
    setLoopHeight(double loopHeight)
    Sets the distance between winds of the helix.
    void
    Sets the orientation of the central axis of the helix.
    void
    Sets the starting point on the helix.
    void
    setTotalHeight(double totalHeight)
    Sets the total height of the helix measured along the central axis.
    void
     
    double
    theta(double height)
    Returns the angle of the point on the helix at the specified height relative to the origin point around the central axis.
     
    double
    Returns the total height of the helix as measured along the central axis.
    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

    • Helix3D Link icon

      public Helix3D()
      Constructs a new Helix3D centered around the origin, with its origin point at (1, 0, 0), looping once clockwise up the y-axis and ending at (1, 1, 0).
    • Helix3D Link icon

      public Helix3D(Point3D origin, Point3D center, Vector3D normal, double totalHeight, double loopHeight, boolean clockwise)
      Constructs a helix from the given parameters.
      Parameters:
      origin - the starting point on the helix
      center - a point at the center of the spiral of the helix
      normal - the overall direction of the helix
      totalHeight - the total height of the helix
      loopHeight - the distance between points on the helix after rotating through a full circle
      clockwise - true if the helix orbits clockwise around its central axis
    • Helix3D Link icon

      public Helix3D(Helix3D helix)
      Creates a new Helix3D identical to the given helix.
      Parameters:
      helix - the helix to copy
  • Method Details Link icon

    • copy Link icon

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

      public void set(Point3D origin, Point3D center, Vector3D normal, double totalHeight, double loopHeight, boolean clockwise)
      Sets the parameters of this helix.
      Parameters:
      origin - the starting point on the helix
      center - a point at the center of the spiral of the helix
      normal - the overall direction of the helix
      totalHeight - the total height of the helix
      loopHeight - the distance between points on the helix after rotating through a full circle
      clockwise - true if the helix orbits clockwise around its central axis
    • setOrigin Link icon

      public void setOrigin(Point3D origin)
      Sets the starting point on the helix.
      Parameters:
      origin - the origin point
    • setCenter Link icon

      public void setCenter(Point3D center)
      Sets the center point of the helix.
      Parameters:
      center - the center point
    • setNormal Link icon

      public void setNormal(Vector3D normal)
      Sets the orientation of the central axis of the helix.
      Parameters:
      normal - the normal
    • setTotalHeight Link icon

      public void setTotalHeight(double totalHeight)
      Sets the total height of the helix measured along the central axis.
      Parameters:
      totalHeight - the total height
    • setLoopHeight Link icon

      public void setLoopHeight(double loopHeight)
      Sets the distance between winds of the helix. The distance between some starting point on the helix and a point arrived at by traveling a complete 360 degrees around a loop the helix.
      Parameters:
      loopHeight - the loop height
    • setClockwise Link icon

      public void setClockwise(boolean clockwise)
      Sets the clockwisedness of the loop. If true the loop spirals clockwise around the central axis/normal.
      Parameters:
      clockwise - if true then the helix spirals clockwise
    • origin Link icon

      public Point3D origin()
      Returns the origin point on the helix.
      Returns:
      the origin point
    • center Link icon

      public Point3D center()
      Returns the central point of the helix.
      Returns:
      the center point
    • normal Link icon

      public Vector3D normal()
      Returns the direction vector of the central axis.
      Returns:
      the normal vector
    • totalHeight Link icon

      public double totalHeight()
      Returns the total height of the helix as measured along the central axis.
      Returns:
      the total height
    • loopHeight Link icon

      public double loopHeight()
      Returns the distance between winds of the helix. The distance between some starting point on the helix and a point arrived at by traveling a complete 360 degrees around a loop the helix.
      Returns:
      the loop height
    • clockwise Link icon

      public boolean clockwise()
      Returns true if the helix spirals clockwise around its central axis.
      Returns:
      true if the helix spirals clockwise around its central axis
    • point Link icon

      public Point3D point(double height)
      Returns the point on the helix at the specified height.
      Parameters:
      height - the height
      Returns:
      the point on the helix at the specified height.
    • theta Link icon

      public double theta(double height)
      Returns the angle of the point on the helix at the specified height relative to the origin point around the central axis.
      Parameters:
      height - the height
      Returns:
      the angle of the point on the helix at that height
    • isPointOnHelix Link icon

      public boolean isPointOnHelix(Point3D point)
      Returns true if the point is on the helix (within 100nm).
      Parameters:
      point - the point
      Returns:
      true if the point is on the helix
    • 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()
      Specified by:
      show in interface Showable
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object