Uses of Class
toxi.geom.Vec2D

Packages that use Vec2D
toxi.geom   
 

Uses of Vec2D in toxi.geom
 

Subclasses of Vec2D in toxi.geom
 class Circle
          This class overrides Ellipse to define a 2D circle and provides several utility methods for it.
 class Ellipse
          This class defines a 2D ellipse and provides several utility methods for it.
 class Ray2D
          A simple 2D ray datatype
 

Fields in toxi.geom declared as Vec2D
 Vec2D Triangle2D.a
           
 Vec2D Line2D.a
           
 Vec2D Triangle2D.b
           
 Vec2D Line2D.b
           
 Vec2D Triangle2D.c
           
 Vec2D Triangle2D.centroid
           
 Vec2D[] Spline2D.coeffA
           
 Vec2D[] Spline2D.delta
           
static Vec2D Vec2D.MAX_VALUE
          Defines vector with both coords set to Float.MAX_VALUE.
static Vec2D Vec2D.MIN_VALUE
          Defines vector with both coords set to Float.MIN_VALUE.
static Vec2D Vec2D.X_AXIS
          Defines positive X axis
static Vec2D Vec2D.Y_AXIS
          Defines positive Y axis
static Vec2D Vec2D.ZERO
          Defines the zero vector.
 

Fields in toxi.geom with type parameters of type Vec2D
 java.util.List<Vec2D> Spline2D.pointList
           
 java.util.List<Vec2D> Spline2D.vertices
           
 java.util.List<Vec2D> Polygon2D.vertices
           
 

Methods in toxi.geom that return Vec2D
 Vec2D Vec2D.abs()
           
 Vec2D Vec2D.add(float a, float b)
          Adds vector {a,b,c} and returns result as new vector.
 Vec2D Vec2D.add(Vec2D v)
          Add vector v and returns result as new vector.
 Vec2D Vec2D.addSelf(float a, float b)
          Adds vector {a,b,c} and overrides coordinates with result.
 Vec2D Vec2D.addSelf(Vec2D v)
          Adds vector v and overrides coordinates with result.
 Vec2D Vec2D.clear()
          Sets all vector components to 0.
 Vec2D Vec2D.closestPointOnLine(Vec2D a, Vec2D b)
          Computes the closest point on the given line segment.
 Vec2D Vec2D.closestPointOnTriangle(Vec2D a, Vec2D b, Vec2D c)
          Finds and returns the closest point on any of the edges of the given triangle.
 Vec2D Triangle2D.computeCentroid()
           
 Vec2D Vec2D.constrain(Rect r)
          Forcefully fits the vector in the given rectangle.
 Vec2D Vec2D.constrain(Vec2D min, Vec2D max)
          Forcefully fits the vector in the given rectangle defined by the points.
 Vec2D Vec2D.copy()
           
 Vec2D Vec2D.floor()
          Replaces the vector components with integer values of their current values
 Vec2D Vec2D.frac()
          Replaces the vector components with the fractional part of their current values
static Vec2D Vec2D.fromTheta(float theta)
          Creates a new vector from the given angle in the XY plane.
 Vec2D Vec2D.getAbs()
           
 Vec2D Rect.getBottomRight()
           
 Vec2D Rect.getCentroid()
          Returns the centroid of the rectangle.
 Vec2D Polygon2D.getCentroid()
          Computes the polygon's centre of mass.
 Vec2D Triangle2D.getClosestVertexTo(Vec2D p)
          Finds and returns the closest point on any of the triangle edges to the point given.
 Vec2D Vec2D.getConstrained(Rect r)
          Creates a copy of the vector which forcefully fits in the given rectangle.
 Vec2D Rect.getDimensions()
          Returns a vector containing the width and height of the rectangle.
 Vec2D Ray2D.getDirection()
          Returns a copy of the ray's direction vector.
 Vec2D Line2D.getDirection()
           
 Vec2D Vec2D.getFloored()
          Creates a new vector whose components are the integer value of their current values
 Vec2D[] Ellipse.getFoci()
           
 Vec2D Vec2D.getFrac()
          Creates a new vector whose components are the fractional part of their current values
 Vec2D Vec2D.getInverted()
          Scales vector uniformly by factor -1 ( v = -v )
 Vec2D Vec2D.getLimited(float lim)
          Creates a copy of the vector with its magnitude limited to the length given
 Vec2D Line2D.getMidPoint()
           
 Vec2D Line2D.getNormal()
           
 Vec2D Vec2D.getNormalized()
          Produces the normalized version as a new vector
 Vec2D Vec2D.getNormalizedTo(float len)
          Produces a new vector normalized to the given length.
 Vec2D Vec2D.getPerpendicular()
           
 Vec2D Ray2D.getPointAtDistance(float dist)
           
 Vec2D Line2D.LineIntersection.getPos()
           
 Vec2D Ellipse.getRadii()
           
 Vec2D Vec2D.getReciprocal()
           
 Vec2D Vec2D.getRotated(float theta)
          Creates a new vector rotated by the given angle around the Z axis.
 Vec2D Vec2D.getSignum()
          Creates a new vector in which all components are replaced with the signum of their original values.
 Vec2D[] Circle.getTangentPoints(Vec2D p)
           
 Vec2D Rect.getTopLeft()
           
 Vec2D Vec2D.interpolateTo(Vec2D v, float f)
          Interpolates the vector towards the given target vector, using linear interpolation
 Vec2D Vec2D.interpolateTo(Vec2D v, float f, InterpolateStrategy s)
          Interpolates the vector towards the given target vector, using the given InterpolateStrategy
 Vec2D Vec2D.interpolateToSelf(Vec2D v, float f)
          Interpolates the vector towards the given target vector, using linear interpolation
 Vec2D Vec2D.interpolateToSelf(Vec2D v, float f, InterpolateStrategy s)
          Interpolates the vector towards the given target vector, using the given InterpolateStrategy
 Vec2D[] Circle.intersectsCircle(Circle c)
           
 Vec2D Rect.intersectsRay(Ray2D ray, float minDist, float maxDist)
          Checks if the rectangle intersects with the given ray and if so computes the first intersection point.
 Vec2D Vec2D.invert()
          Scales vector uniformly by factor -1 ( v = -v ), overrides coordinates with result
 Vec2D Vec2D.jitter(float j)
           
 Vec2D Vec2D.jitter(float jx, float jy)
          Adds random jitter to the vector.
 Vec2D Vec2D.jitter(Vec2D jv)
           
 Vec2D Vec2D.limit(float lim)
          Limits the vector's magnitude to the length given
 Vec2D Vec2D.max(Vec2D v)
          Constructs a new vector consisting of the largest components of both vectors.
static Vec2D Vec2D.max(Vec2D a, Vec2D b)
          Constructs a new vector consisting of the largest components of both vectors.
 Vec2D Vec2D.maxSelf(Vec2D v)
          Adjusts the vector components to the maximum values of both vectors
 Vec2D Vec2D.min(Vec2D v)
          Constructs a new vector consisting of the smallest components of both vectors.
static Vec2D Vec2D.min(Vec2D a, Vec2D b)
          Constructs a new vector consisting of the smallest components of both vectors.
 Vec2D Vec2D.minSelf(Vec2D v)
          Adjusts the vector components to the minimum values of both vectors
 Vec2D Vec2D.normalize()
          Normalizes the vector so that its magnitude = 1
 Vec2D Vec2D.normalizeTo(float len)
          Normalizes the vector to the given length.
 Vec2D Vec2D.perpendicular()
           
static Vec2D Vec2D.randomVector()
          Static factory method.
static Vec2D Vec2D.randomVector(java.util.Random rnd)
          Static factory method.
 Vec2D Vec2D.reciprocal()
           
 Vec2D Vec2D.rotate(float theta)
          Rotates the vector by the given angle around the Z axis.
 Vec2D Vec2D.scale(float s)
          Scales vector uniformly and returns result as new vector.
 Vec2D Vec2D.scale(float a, float b)
          Scales vector non-uniformly and returns result as new vector.
 Vec2D Vec2D.scale(Vec2D s)
          Scales vector non-uniformly by vector v and returns result as new vector
 Vec2D Vec2D.scaleSelf(float s)
          Scales vector uniformly and overrides coordinates with result
 Vec2D Vec2D.scaleSelf(float a, float b)
          Scales vector non-uniformly by vector {a,b,c} and overrides coordinates with result
 Vec2D Vec2D.scaleSelf(Vec2D s)
          Scales vector non-uniformly by vector v and overrides coordinates with result
 Vec2D Vec2D.set(float x, float y)
          Overrides coordinates with the given values
 Vec2D Vec2D.set(Vec2D v)
          Overrides coordinates with the ones of the given vector
 Vec2D Vec2D.setComponent(Vec2D.Axis id, float val)
           
 Vec2D Vec2D.signum()
          Replaces all vector components with the signum of their original values.
 Vec2D Vec2D.sub(float a, float b)
          Subtracts vector {a,b,c} and returns result as new vector.
 Vec2D Vec2D.sub(Vec2D v)
          Subtracts vector v and returns result as new vector.
 Vec2D Vec2D.subSelf(float a, float b)
          Subtracts vector {a,b,c} and overrides coordinates with result.
 Vec2D Vec2D.subSelf(Vec2D v)
          Subtracts vector v and overrides coordinates with result.
 Vec2D Vec2D.tangentNormalOfEllipse(Vec2D eO, Vec2D eR)
          Calculates the normal vector on the given ellipse in the direction of the current point.
 Vec2D Vec3D.to2DXY()
          Creates a new 2D vector of the XY components.
 Vec2D Vec3D.to2DXZ()
          Creates a new 2D vector of the XZ components.
 Vec2D Vec3D.to2DYZ()
          Creates a new 2D vector of the YZ components.
 Vec2D Vec2D.toCartesian()
          Converts the vector from polar to Cartesian space.
 Vec2D Vec2D.toPolar()
          Converts the current vector into polar coordinates.
 

Methods in toxi.geom that return types with arguments of type Vec2D
 java.util.List<Vec2D> Spline2D.computeVertices(int res)
           Computes all curve vertices based on the resolution/number of subdivisions requested.
 java.util.List<Vec2D> Spline2D.getDecimatedVertices(float step)
          Computes a list of points along the spline which are uniformly separated by the given step distance.
 java.util.List<Vec2D> Spline2D.getDecimatedVertices(float step, boolean doAddFinalVertex)
          Computes a list of points along the spline which are uniformly separated by the given step distance.
 java.util.List<Vec2D> Spline2D.getPointList()
           
 java.util.ArrayList<Vec2D> Line2D.splitIntoSegments(java.util.ArrayList<Vec2D> segments, float stepLength, boolean addFirst)
           
static java.util.ArrayList<Vec2D> Line2D.splitIntoSegments(Vec2D a, Vec2D b, float stepLength, java.util.ArrayList<Vec2D> segments, boolean addFirst)
          Splits the line between A and B into segments of the given length, starting at point A.
 

Methods in toxi.geom with parameters of type Vec2D
 Vec2D Vec2D.add(Vec2D v)
          Add vector v and returns result as new vector.
 Spline2D Spline2D.add(Vec2D p)
          Adds the given point to the list of control points.
 Polygon2D Polygon2D.add(Vec2D p)
           
 Vec2D Vec2D.addSelf(Vec2D v)
          Adds vector v and overrides coordinates with result.
 float Vec2D.angleBetween(Vec2D v)
          Computes the angle between this vector and vector V.
 float Vec2D.angleBetween(Vec2D v, boolean forceNormalize)
          Computes the angle between this vector and vector V
 Vec2D Vec2D.closestPointOnLine(Vec2D a, Vec2D b)
          Computes the closest point on the given line segment.
 Vec2D Vec2D.closestPointOnTriangle(Vec2D a, Vec2D b, Vec2D c)
          Finds and returns the closest point on any of the edges of the given triangle.
 int Vec2D.compareTo(Vec2D v)
          Compares the length of the vector with another one.
 Vec2D Vec2D.constrain(Vec2D min, Vec2D max)
          Forcefully fits the vector in the given rectangle defined by the points.
 boolean Triangle2D.containsPoint(Vec2D p)
          Checks if point vector is inside the triangle created by the points a, b and c.
 boolean Rect.containsPoint(Vec2D p)
          Checks if the given point is within the rectangle's bounds.
 boolean Ellipse.containsPoint(Vec2D p)
           
 boolean Circle.containsPoint(Vec2D p)
           
static Triangle2D Triangle2D.createEquilateralFrom(Vec2D a, Vec2D b)
           
 float Vec2D.cross(Vec2D v)
          Calculates the cross-product with the given vector.
 float Vec2D.distanceTo(Vec2D v)
          Calculates distance to another vector
 float Vec2D.distanceToSquared(Vec2D v)
          Calculates the squared distance to another vector
 float Vec2D.dot(Vec2D v)
          Computes the scalar product (dot product) with the given vector.
 boolean Vec2D.equalsWithTolerance(Vec2D v, float tolerance)
          Compares this vector with the one given.
static Rect Rect.fromCenterExtent(Vec2D center, Vec2D extent)
          Factory method, constructs a new rectangle from a center point and extent vector.
 Vec2D Triangle2D.getClosestVertexTo(Vec2D p)
          Finds and returns the closest point on any of the triangle edges to the point given.
 Vec2D[] Circle.getTangentPoints(Vec2D p)
           
 Vec2D Vec2D.interpolateTo(Vec2D v, float f)
          Interpolates the vector towards the given target vector, using linear interpolation
 Vec2D Vec2D.interpolateTo(Vec2D v, float f, InterpolateStrategy s)
          Interpolates the vector towards the given target vector, using the given InterpolateStrategy
 Vec2D Vec2D.interpolateToSelf(Vec2D v, float f)
          Interpolates the vector towards the given target vector, using linear interpolation
 Vec2D Vec2D.interpolateToSelf(Vec2D v, float f, InterpolateStrategy s)
          Interpolates the vector towards the given target vector, using the given InterpolateStrategy
 float Vec2D.intersectRayCircle(Vec2D rayDir, Vec2D circleOrigin, float circleRadius)
          Calculates the distance of the vector to the given sphere in the specified direction.
static boolean Triangle2D.isClockwise(Vec2D a, Vec2D b, Vec2D c)
           
 boolean Vec2D.isInCircle(Vec2D sO, float sR)
          Checks if the point is inside the given sphere.
 boolean Vec2D.isInTriangle(Vec2D a, Vec2D b, Vec2D c)
          Checks if point vector is inside the triangle created by the points a, b and c.
 Vec2D Vec2D.jitter(Vec2D jv)
           
 Vec2D Vec2D.max(Vec2D v)
          Constructs a new vector consisting of the largest components of both vectors.
static Vec2D Vec2D.max(Vec2D a, Vec2D b)
          Constructs a new vector consisting of the largest components of both vectors.
 Vec2D Vec2D.maxSelf(Vec2D v)
          Adjusts the vector components to the maximum values of both vectors
 Vec2D Vec2D.min(Vec2D v)
          Constructs a new vector consisting of the smallest components of both vectors.
static Vec2D Vec2D.min(Vec2D a, Vec2D b)
          Constructs a new vector consisting of the smallest components of both vectors.
 Vec2D Vec2D.minSelf(Vec2D v)
          Adjusts the vector components to the minimum values of both vectors
 Vec2D Vec2D.scale(Vec2D s)
          Scales vector non-uniformly by vector v and returns result as new vector
 Vec2D Vec2D.scaleSelf(Vec2D s)
          Scales vector non-uniformly by vector v and overrides coordinates with result
 Vec2D Vec2D.set(Vec2D v)
          Overrides coordinates with the ones of the given vector
 void Triangle2D.set(Vec2D a2, Vec2D b2, Vec2D c2)
           
 Rect Rect.setDimension(Vec2D dim)
           
 Ray2D Ray2D.setDirection(Vec2D d)
          Uses a normalized copy of the given vector as the ray direction.
 Rect Rect.setPosition(Vec2D pos)
           
 Ellipse Ellipse.setRadii(Vec2D r)
          Sets the radii of the ellipse to the values given by the vector.
 Vec3D Vec3D.setXY(Vec2D v)
          Overrides XY coordinates with the ones of the given 2D vector.
static java.util.ArrayList<Vec2D> Line2D.splitIntoSegments(Vec2D a, Vec2D b, float stepLength, java.util.ArrayList<Vec2D> segments, boolean addFirst)
          Splits the line between A and B into segments of the given length, starting at point A.
 Vec2D Vec2D.sub(Vec2D v)
          Subtracts vector v and returns result as new vector.
 Vec2D Vec2D.subSelf(Vec2D v)
          Subtracts vector v and overrides coordinates with result.
 Vec2D Vec2D.tangentNormalOfEllipse(Vec2D eO, Vec2D eR)
          Calculates the normal vector on the given ellipse in the direction of the current point.
 

Method parameters in toxi.geom with type arguments of type Vec2D
 boolean Vec2D.pointInPolygon(java.util.ArrayList<Vec2D> vertices)
          Checks if the point is within the convex polygon defined by the points in the given list
 Spline2D Spline2D.setPointList(java.util.List<Vec2D> plist)
          Overrides the current control points with the given list.
 java.util.ArrayList<Vec2D> Line2D.splitIntoSegments(java.util.ArrayList<Vec2D> segments, float stepLength, boolean addFirst)
           
static java.util.ArrayList<Vec2D> Line2D.splitIntoSegments(Vec2D a, Vec2D b, float stepLength, java.util.ArrayList<Vec2D> segments, boolean addFirst)
          Splits the line between A and B into segments of the given length, starting at point A.
 

Constructors in toxi.geom with parameters of type Vec2D
Circle(Vec2D origin, float radius)
           
Ellipse(Vec2D v, float r)
           
Ellipse(Vec2D v, Vec2D r)
           
Line2D.LineIntersection(Line2D.LineIntersection.Type type, Vec2D pos)
           
Line2D(Vec2D a, Vec2D b)
           
Ray2D(float x, float y, Vec2D d)
           
Ray2D(Vec2D o, Vec2D d)
           
Rect(Vec2D topLeft, Vec2D bottomRight)
          Constructs a new rectangle defined by its top left and bottom right points.
Spline2D(Vec2D[] pointArray)
           
Spline2D(Vec2D[] pointArray, BernsteinPolynomial b, float tightness)
           
Triangle2D(Vec2D a, Vec2D b, Vec2D c)
           
Vec2D(Vec2D v)
          Creates a new vector with the coordinates of the given vector
 

Constructor parameters in toxi.geom with type arguments of type Vec2D
Polygon2D(java.util.List<Vec2D> points)
           
Spline2D(java.util.List<Vec2D> rawPoints)
           
Spline2D(java.util.List<Vec2D> rawPoints, BernsteinPolynomial b, float tightness)