Package arc.math.geom

Class Segment

java.lang.Object
arc.math.geom.Segment

public class Segment extends Object
A Segment is a line in 3-space having a staring and an ending position.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Vec3
    the starting position
    final Vec3
    the ending position
  • Constructor Summary

    Constructors
    Constructor
    Description
    Segment(float aX, float aY, float aZ, float bX, float bY, float bZ)
    Constructs a new Segment from the two points given.
    Segment(Vec3 a, Vec3 b)
    Constructs a new Segment from the two points given.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    float
    len()
     
    float
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • a

      public final Vec3 a
      the starting position
    • b

      public final Vec3 b
      the ending position
  • Constructor Details

    • Segment

      public Segment(Vec3 a, Vec3 b)
      Constructs a new Segment from the two points given.
      Parameters:
      a - the first point
      b - the second point
    • Segment

      public Segment(float aX, float aY, float aZ, float bX, float bY, float bZ)
      Constructs a new Segment from the two points given.
      Parameters:
      aX - the x-coordinate of the first point
      aY - the y-coordinate of the first point
      aZ - the z-coordinate of the first point
      bX - the x-coordinate of the second point
      bY - the y-coordinate of the second point
      bZ - the z-coordinate of the second point
  • Method Details

    • len

      public float len()
    • len2

      public float len2()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object