Package mgui.geometry

Class Vector2D

java.lang.Object
mgui.geometry.Shape2D
mgui.geometry.Vector2D
All Implemented Interfaces:
java.lang.Cloneable, Shape, XMLObject

public class Vector2D
extends Shape2D
Represents a 2D vector, defined by an end-point and a vector.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

    • start

      public org.jogamp.vecmath.Point2f start
    • vector

      public org.jogamp.vecmath.Vector2f vector
  • Constructor Details

    • Vector2D

      public Vector2D​(org.jogamp.vecmath.Point2f start, org.jogamp.vecmath.Vector2f vector)
    • Vector2D

      public Vector2D​(Vector2D vector)
    • Vector2D

      public Vector2D​(float x_start, float y_start, float x_vector, float y_vector)
  • Method Details

    • getStart

      public org.jogamp.vecmath.Point2f getStart()
    • getVector

      public org.jogamp.vecmath.Vector2f getVector()
    • getEndPoint

      public org.jogamp.vecmath.Point2f getEndPoint()
    • getVertices

      public java.util.ArrayList<org.jogamp.vecmath.Point2f> getVertices()
      Specified by:
      getVertices in class Shape2D
    • setVertices

      public void setVertices​(java.util.ArrayList<org.jogamp.vecmath.Point2f> vertices)
      Specified by:
      setVertices in class Shape2D
    • getVertex

      public org.jogamp.vecmath.Point2f getVertex​(int i)
      Specified by:
      getVertex in class Shape2D
    • asLineSegment

      public LineSegment2D asLineSegment()