Module JNISpice
Package spice.basic

Class Line


  • public class Line
    extends java.lang.Object
    Class Line represents lines in three-dimensional Euclidean space.

    Lines always have non-zero direction vectors.

    Version 1.0.0 01-DEC-2009 (NJB)

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Ray ray  
    • Constructor Summary

      Constructors 
      Constructor Description
      Line()
      Zero-arguments constructor.
      Line​(Line line)
      Copy constructor.This constructor creates a deep copy.
      Line​(Ray ray)
      Create a Line from a Ray.
      Line​(Vector3 point, Vector3 direction)
      Create a Line from a point and direction.
    • Method Summary

      Modifier and Type Method Description
      Vector3 getDirection()
      Return a direction vector for this Line.
      Vector3 getNearPoint​(Vector3 point)
      Find the closest point on this line to a specified point.
      Vector3 getPoint()
      Return a point on this Line.
      Ray getRay()
      Return a ray included by this Line.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ray

        private Ray ray
    • Constructor Detail

      • Line

        public Line()
        Zero-arguments constructor. This creates a line coincident with the Z axis.
      • Line

        public Line​(Line line)
        Copy constructor.This constructor creates a deep copy.
        Parameters:
        line - Line
      • Line

        public Line​(Ray ray)
        Create a Line from a Ray.
        Parameters:
        ray - Ray
    • Method Detail

      • getRay

        public Ray getRay()
        Return a ray included by this Line.
        Returns:
        Ray
      • getPoint

        public Vector3 getPoint()
        Return a point on this Line.
        Returns:
        Vector3
      • getDirection

        public Vector3 getDirection()
        Return a direction vector for this Line.
        Returns:
        Vector3
      • getNearPoint

        public Vector3 getNearPoint​(Vector3 point)
                             throws SpiceException
        Find the closest point on this line to a specified point.
        Parameters:
        point - Vector3
        Returns:
        Vector3
        Throws:
        SpiceException - exception