Package snap.gfx3d

Class Line3D

java.lang.Object
snap.gfx3d.Line3D
All Implemented Interfaces:
Cloneable

public class Line3D extends Object implements Cloneable
This class represents a 3D line.
  • Constructor Details

    • Line3D

      public Line3D(Point3D p1, Point3D p2)
      Constructor.
    • Line3D

      public Line3D(double x1, double y1, double z1, double x2, double y2, double z2)
      Constructor.
  • Method Details

    • getP1

      public Point3D getP1()
      Returns the first point.
    • getP2

      public Point3D getP2()
      Returns the second point.
    • getLength

      public double getLength()
      Returns the distance between the XY components (assumes the line is in View space).
    • getLengthXY

      public double getLengthXY()
      Returns the distance between the XY components (assumes the line is in View space).
    • extendEndPointForFraction

      public void extendEndPointForFraction(double aValue)
      Changes line end point for fractional value. E.g.: 2 doubles length of line.
    • getAngle2DInDeg

      public double getAngle2DInDeg()
      Returns the angle between two XY points.
    • clone

      public Line3D clone()
      Standard clone implementation.
      Overrides:
      clone in class Object
    • getAngleBetweenPoints2DInDeg

      public static double getAngleBetweenPoints2DInDeg(double x1, double y1, double x2, double y2)
      Returns the angle between two XY points.