Uses of Class
toxi.geom.Vec2D
Packages that use Vec2D
Package
Description
-
Uses of Vec2D in toxi.geom
Modifier and TypeClassDescriptionclassThis class overridesEllipseto define a 2D circle and provides several utility methods for it, including factory methods to construct circles from points.classThis class defines a 2D ellipse and provides several utility methods for it.classA simple 2D ray datatypeModifier and TypeFieldDescriptionLine2D.aTriangle2D.aLine2D.bTriangle2D.bTriangle2D.cTriangle2D.centroidVec2D[]Spline2D.coeffAVec2D[]Spline2D.deltaModifier and TypeMethodDescriptionfinal Vec2DVec2D.abs()ReadonlyVec2D.add(float a, float b) Adds vector {a,b,c} and returns result as new vector.ReadonlyVec2D.add(ReadonlyVec2D v) Add vector v and returns result as new vector.final Vec2DVec2D.add(float a, float b) Vec2D.add(ReadonlyVec2D v) final Vec2Dfinal Vec2DVec2D.addSelf(float a, float b) Adds vector {a,b,c} and overrides coordinates with result.final Vec2DAdds vector v and overrides coordinates with result.final Vec2DVec2D.clear()Sets all vector components to 0.Line2D.closestPointTo(ReadonlyVec2D p) Computes the closest point on this line to the point given.Triangle2D.computeCentroid()static Vec2DBezierCurve2D.computePointInSegment(Vec2D a, Vec2D b, Vec2D c, Vec2D d, float t) static Vec2DBezierCurve2D.computeTangentInSegment(Vec2D a, Vec2D b, Vec2D c, Vec2D d, float t) Constraints this vector to the perimeter of the given polygon.Forcefully fits the vector in the given rectangle.Forcefully fits the vector in the given rectangle defined by the points.ReadonlyVec2D.copy()final Vec2DVec2D.copy()final Vec2DVec2D.floor()Replaces the vector components with integer values of their current valuesfinal Vec2DVec2D.frac()Replaces the vector components with the fractional part of their current valuesTriangle2D.fromBarycentric(ReadonlyVec3D p) static final Vec2DVec2D.fromTheta(float theta) Creates a new vector from the given angle in the XY plane.LineStrip2D.get(int i) Returns the vertex at the given index.Polygon2D.get(int i) Returns the vertex at the given index.ReadonlyVec2D.getAbs()final Vec2DVec2D.getAbs()Rect.getBottomLeft()final Vec2DRect.getBottomRight()ReadonlyVec2D.getCartesian()Converts the vector from polar to Cartesian space.Vec2D.getCartesian()LineStrip2D.getCentroid()Polygon2D.getCentroid()Computes the polygon's centre of mass.final Vec2DRect.getCentroid()Returns the centroid of the rectangle.Polygon2D.getClosestPointTo(ReadonlyVec2D p) Triangle2D.getClosestPointTo(ReadonlyVec2D p) Finds and returns the closest point on any of the triangle edges to the point given.Polygon2D.getClosestVertexTo(ReadonlyVec2D p) ReadonlyVec2D.getConstrained(Rect r) Creates a copy of the vector which forcefully fits in the given rectangle.final Vec2DVec2D.getConstrained(Polygon2D poly) final Vec2DVec2D.getConstrained(Rect r) final Vec2DRect.getDimensions()Returns a vector containing the width and height of the rectangle.Line2D.getDirection()Ray2D.getDirection()Returns a copy of the ray's direction vector.ReadonlyVec2D.getFloored()Creates a new vector whose components are the integer value of their current valuesfinal Vec2DVec2D.getFloored()Vec2D[]Ellipse.getFoci()ReadonlyVec2D.getFrac()Creates a new vector whose components are the fractional part of their current valuesfinal Vec2DVec2D.getFrac()ReadonlyVec2D.getInverted()Scales vector uniformly by factor -1 ( v = -v )final Vec2DVec2D.getInverted()ReadonlyVec2D.getLimited(float lim) Creates a copy of the vector with its magnitude limited to the length givenfinal Vec2DVec2D.getLimited(float lim) Produces a new vector with its coordinates passed through the givenScaleMap.Rect.getMappedPointInRect(Vec2D p) Computes the normalized position of the given point within this rectangle, so that a point at the top-left corner becomes {0,0} and bottom-right {1,1}.Line2D.getMidPoint()Line2D.getNormal()ReadonlyVec2D.getNormalized()Produces the normalized version as a new vectorfinal Vec2DVec2D.getNormalized()ReadonlyVec2D.getNormalizedTo(float len) Produces a new vector normalized to the given length.final Vec2DVec2D.getNormalizedTo(float len) ReadonlyVec2D.getPerpendicular()final Vec2DVec2D.getPerpendicular()LineStrip2D.getPointAt(float t) Computes point at position t, where t is the normalized position along the strip.Ray2D.getPointAtDistance(float dist) ReadonlyVec2D.getPolar()Converts the current vector into polar coordinates.Vec2D.getPolar()Line2D.LineIntersection.getPos()Returns copy of intersection point.Ellipse.getRadii()Ellipse.getRandomPoint()Creates a random point within the ellipse using aBiasedFloatRangeto create a more uniform distribution.Polygon2D.getRandomPoint()Creates a random point within the polygon.Rect.getRandomPoint()Creates a random point within the rectangle.Shape2D.getRandomPoint()Computes a random point within the shape's perimeter.Triangle2D.getRandomPoint()Creates a random point within the triangle using barycentric coordinates.ReadonlyVec2D.getReciprocal()final Vec2DVec2D.getReciprocal()ReadonlyVec2D.getReflected(ReadonlyVec2D normal) final Vec2DVec2D.getReflected(ReadonlyVec2D normal) ReadonlyVec2D.getRotated(float theta) Creates a new vector rotated by the given angle around the Z axis.final Vec2DVec2D.getRotated(float theta) ReadonlyVec2D.getRoundedTo(float prec) Creates a new vector with its coordinates rounded to the given precision (grid alignment).Vec2D.getRoundedTo(float prec) ReadonlyVec2D.getSignum()Creates a new vector in which all components are replaced with the signum of their original values.Vec2D.getSignum()Vec2D[]Circle.getTangentPoints(ReadonlyVec2D p) final Vec2DRect.getTopLeft()Rect.getTopRight()Rect.getUnmappedPointInRect(Vec2D p) Inverse operation ofRect.getMappedPointInRect(Vec2D).Vec2D[]Triangle2D.getVertexArray()Vec2D[]Triangle2D.getVertexArray(Vec2D[] array, int offset) ReadonlyVec2D.interpolateTo(ReadonlyVec2D v, float f) Interpolates the vector towards the given target vector, using linear interpolationReadonlyVec2D.interpolateTo(ReadonlyVec2D v, float f, InterpolateStrategy s) Interpolates the vector towards the given target vector, using the givenInterpolateStrategyVec2D.interpolateTo(ReadonlyVec2D v, float f) Vec2D.interpolateTo(ReadonlyVec2D v, float f, InterpolateStrategy s) final Vec2DVec2D.interpolateTo(Vec2D v, float f) Vec2D.interpolateTo(Vec2D v, float f, InterpolateStrategy s) final Vec2DVec2D.interpolateToSelf(ReadonlyVec2D v, float f) Interpolates the vector towards the given target vector, using linear interpolationVec2D.interpolateToSelf(ReadonlyVec2D v, float f, InterpolateStrategy s) Interpolates the vector towards the given target vector, using the givenInterpolateStrategyVec2D[]Circle.intersectsCircle(Circle c) final Vec2DVec2D.invert()Scales vector uniformly by factor -1 ( v = -v ), overrides coordinates with resultfinal Vec2DVec2D.jitter(float j) final Vec2DVec2D.jitter(float jx, float jy) Adds random jitter to the vector in the range -j ...final Vec2Dfinal Vec2Dfinal Vec2Dfinal Vec2Dfinal Vec2DVec2D.limit(float lim) Limits the vector's magnitude to the length givenReadonlyVec2D.max(ReadonlyVec2D v) Constructs a new vector consisting of the largest components of both vectors.final Vec2DVec2D.max(ReadonlyVec2D v) static final Vec2DVec2D.max(ReadonlyVec2D a, ReadonlyVec2D b) Constructs a new vector consisting of the largest components of both vectors.final Vec2DVec2D.maxSelf(ReadonlyVec2D v) Adjusts the vector components to the maximum values of both vectorsReadonlyVec2D.min(ReadonlyVec2D v) Constructs a new vector consisting of the smallest components of both vectors.final Vec2DVec2D.min(ReadonlyVec2D v) static final Vec2DVec2D.min(ReadonlyVec2D a, ReadonlyVec2D b) Constructs a new vector consisting of the smallest components of both vectors.final Vec2DVec2D.minSelf(ReadonlyVec2D v) Adjusts the vector components to the minimum values of both vectorsfinal Vec2DVec2D.normalize()Normalizes the vector so that its magnitude = 1final Vec2DVec2D.normalizeTo(float len) Normalizes the vector to the given length.final Vec2DVec2D.perpendicular()static final Vec2DVec2D.randomVector()Static factory method.static final Vec2DVec2D.randomVector(Random rnd) Static factory method.final Vec2DVec2D.reciprocal()final Vec2DVec2D.reflect(ReadonlyVec2D normal) final Vec2DVec2D.rotate(float theta) Rotates the vector by the given angle around the Z axis.Vec2D.roundTo(float prec) ReadonlyVec2D.scale(float s) Scales vector uniformly and returns result as new vector.ReadonlyVec2D.scale(float a, float b) Scales vector non-uniformly and returns result as new vector.ReadonlyVec2D.scale(ReadonlyVec2D s) Scales vector non-uniformly by vector v and returns result as new vectorfinal Vec2DVec2D.scale(float s) final Vec2DVec2D.scale(float a, float b) final Vec2DVec2D.scale(ReadonlyVec2D s) final Vec2Dfinal Vec2DVec2D.scaleSelf(float s) Scales vector uniformly and overrides coordinates with resultfinal Vec2DVec2D.scaleSelf(float a, float b) Scales vector non-uniformly by vector {a,b,c} and overrides coordinates with resultfinal Vec2DScales vector non-uniformly by vector v and overrides coordinates with resultfinal Vec2DVec2D.set(float x, float y) Overrides coordinates with the given valuesfinal Vec2DVec2D.set(ReadonlyVec2D v) final Vec2DOverrides coordinates with the ones of the given vectorfinal Vec2DVec2D.setComponent(int id, float val) final Vec2DVec2D.setComponent(Vec2D.Axis id, float val) Vec2D.setX(float x) Vec2D.setY(float y) final Vec2DVec2D.signum()Replaces all vector components with the signum of their original values.final Vec2DVec2D.snapToAxis()Rounds the vector to the closest major axis.ReadonlyVec2D.sub(float a, float b) Subtracts vector {a,b,c} and returns result as new vector.ReadonlyVec2D.sub(ReadonlyVec2D v) Subtracts vector v and returns result as new vector.final Vec2DVec2D.sub(float a, float b) final Vec2DVec2D.sub(ReadonlyVec2D v) final Vec2Dfinal Vec2DVec2D.subSelf(float a, float b) Subtracts vector {a,b,c} and overrides coordinates with result.final Vec2DSubtracts vector v and overrides coordinates with result.ReadonlyVec2D.tangentNormalOfEllipse(Vec2D eO, Vec2D eR) Calculates the normal vector on the given ellipse in the direction of the current point.final Vec2DVec2D.tangentNormalOfEllipse(Vec2D eO, Vec2D eR) ReadonlyVec3D.to2DXY()Creates a new 2D vector of the XY components.final Vec2DVec3D.to2DXY()ReadonlyVec3D.to2DXZ()Creates a new 2D vector of the XZ components.final Vec2DVec3D.to2DXZ()ReadonlyVec3D.to2DYZ()Creates a new 2D vector of the YZ components.final Vec2DVec3D.to2DYZ()final Vec2DVec2D.toCartesian()final Vec2DVec2D.toPolar()Modifier and TypeMethodDescriptionLineStrip2D.getDecimatedVertices(float step) Computes a list of points along the spline which are uniformly separated by the given step distance.LineStrip2D.getDecimatedVertices(float step, boolean doAddFinalVertex) Computes a list of points along the spline which are close to uniformly separated by the given step distance.Spline2D.getPointList()LineStrip2D.getVertices()PointQuadtree.itemsWithinRadius(Vec2D p, float radius, List<Vec2D> results) PointQuadtree.itemsWithinRect(Rect bounds, List<Vec2D> results) LineStrip2D.iterator()Polygon2D.iterator()Line2D.splitIntoSegments(List<Vec2D> segments, float stepLength, boolean addFirst) Line2D.splitIntoSegments(Vec2D a, Vec2D b, float stepLength, List<Vec2D> segments, boolean addFirst) Splits the line between A and B into segments of the given length, starting at point A.Modifier and TypeMethodDescriptionAdds a new vertex to the polygon (builder pattern).final Vec2Dfinal Vec2DAdds vector v and overrides coordinates with result.Computes the perpendicular bisector of two points.static Vec2DBezierCurve2D.computePointInSegment(Vec2D a, Vec2D b, Vec2D c, Vec2D d, float t) static Vec2DBezierCurve2D.computeTangentInSegment(Vec2D a, Vec2D b, Vec2D c, Vec2D d, float t) Forcefully fits the vector in the given rectangle defined by the points.static CircleCircle.from2Points(Vec2D p1, Vec2D p2) Factory method to construct a circle which has the two given points lying on its perimeter.static CircleCircle.from3Points(Vec2D p1, Vec2D p2, Vec2D p3) Factory method to construct a circle which has the three given points lying on its perimeter.static Polygon2DPolygon2D.fromBaseEdge(Vec2D baseA, Vec2D baseB, int res) Constructs a new regular polygon from the given base line/edge.static final RectRect.fromCenterExtent(ReadonlyVec2D center, Vec2D extent) Factory method, constructs a new rectangle from a center point and extent vector.floatRay2D.getDistanceToPoint(Vec2D p) Calculates the distance between the given point and the infinite line coinciding with this ray.Rect.getMappedPointInRect(Vec2D p) Computes the normalized position of the given point within this rectangle, so that a point at the top-left corner becomes {0,0} and bottom-right {1,1}.Rect.getUnmappedPointInRect(Vec2D p) Inverse operation ofRect.getMappedPointInRect(Vec2D).Vec2D[]Triangle2D.getVertexArray(Vec2D[] array, int offset) booleanLine2D.hasEndPoint(Vec2D p) booleanfinal Vec2DVec2D.interpolateTo(Vec2D v, float f) Vec2D.interpolateTo(Vec2D v, float f, InterpolateStrategy s) booleanRect.intersectsCircle(Vec2D c, float r) static booleanTriangle2D.isClockwise(Vec2D a, Vec2D b, Vec2D c) booleanbooleanReadonlyVec2D.isInTriangle(Vec2D a, Vec2D b, Vec2D c) Checks if point vector is inside the triangle created by the points a, b and c.booleanVec2D.isInTriangle(Vec2D a, Vec2D b, Vec2D c) PointQuadtree.itemsWithinRadius(Vec2D p, float radius, List<Vec2D> results) final Vec2Dfinal Vec2DLine2D.offsetAndGrowBy(float offset, float scale, Vec2D ref) booleanScales vector non-uniformly by vector v and returns result as new vectorfinal Vec2Dfinal Vec2DScales vector non-uniformly by vector v and overrides coordinates with resultvoidfinal Vec2DOverrides coordinates with the ones of the given vectorfinal RectRect.setDimension(Vec2D dim) final RectRect.setPosition(Vec2D pos) Overrides XY coordinates with the ones of the given 2D vector.Line2D.splitIntoSegments(Vec2D a, Vec2D b, float stepLength, List<Vec2D> segments, boolean addFirst) Splits the line between A and B into segments of the given length, starting at point A.Subtracts vector v and returns result as new vector.final Vec2Dfinal Vec2DSubtracts vector v and overrides coordinates with result.doubleSphere.surfaceDistanceBetween(Vec2D p, Vec2D q) Computes the surface distance on this sphere between two points given as lon/lat coordinates.ReadonlyVec2D.tangentNormalOfEllipse(Vec2D eO, Vec2D eR) Calculates the normal vector on the given ellipse in the direction of the current point.final Vec2DVec2D.tangentNormalOfEllipse(Vec2D eO, Vec2D eR) booleanModifier and TypeMethodDescriptionstatic final RectRect.getBoundingRect(List<? extends Vec2D> points) Factory method, computes & returns the bounding rect for the given list of points.PointQuadtree.itemsWithinRadius(Vec2D p, float radius, List<Vec2D> results) PointQuadtree.itemsWithinRect(Rect bounds, List<Vec2D> results) static CircleCircle.newBoundingCircle(List<Vec2D> vertices) Spline2D.setPointList(List<Vec2D> plist) Overrides the current control points with the given list.voidLineStrip2D.setVertices(List<Vec2D> vertices) Line2D.splitIntoSegments(List<Vec2D> segments, float stepLength, boolean addFirst) Line2D.splitIntoSegments(Vec2D a, Vec2D b, float stepLength, List<Vec2D> segments, boolean addFirst) Splits the line between A and B into segments of the given length, starting at point A.ModifierConstructorDescriptionSpline2D(Vec2D[] pointArray, BernsteinPolynomial b, float tightness) ModifierConstructorDescriptionBezierCurve2D(List<Vec2D> points) LineStrip2D(Collection<? extends Vec2D> vertices) Spline2D(List<Vec2D> rawPoints, BernsteinPolynomial b, float tightness) -
Uses of Vec2D in toxi.geom.mesh
Fields in toxi.geom.mesh declared as Vec2DMethods in toxi.geom.mesh that return Vec2DMethods in toxi.geom.mesh with parameters of type Vec2DModifier and TypeMethodDescriptionAdds the given 3 points as triangle face to the mesh and assigns the given texture coordinates to each vertex.voidConstructors in toxi.geom.mesh with parameters of type Vec2D -
Uses of Vec2D in toxi.geom.mesh2d
Methods in toxi.geom.mesh2d that return Vec2DMethods in toxi.geom.mesh2d that return types with arguments of type Vec2DMethods in toxi.geom.mesh2d with parameters of type Vec2DMethod parameters in toxi.geom.mesh2d with type arguments of type Vec2D -
Uses of Vec2D in toxi.geom.nurbs
Methods in toxi.geom.nurbs that return Vec2DMethods in toxi.geom.nurbs with parameters of type Vec2DConstructors in toxi.geom.nurbs with parameters of type Vec2D -
Uses of Vec2D in toxi.math
-
Uses of Vec2D in toxi.math.waves
Fields in toxi.math.waves declared as Vec2D -
Uses of Vec2D in toxi.newmesh
Methods in toxi.newmesh with parameters of type Vec2D -
Uses of Vec2D in toxi.physics2d
Subclasses of Vec2D in toxi.physics2dModifier and TypeClassDescriptionclassAn individual 3D particle for use by the VerletPhysics and VerletSpring classes.Methods in toxi.physics2d that return Vec2DModifier and TypeMethodDescriptionVerletParticle2D.getForce()VerletParticle2D.getPreviousPosition()Returns the particle's position at the most recent time step.VerletParticle2D.getVelocity()Methods in toxi.physics2d that return types with arguments of type Vec2DMethods in toxi.physics2d with parameters of type Vec2DModifier and TypeMethodDescriptionVerletParticle2D.addVelocity(Vec2D v) Attempts to find the spring element between the 2 particles suppliedVerletParticle2D.setPreviousPosition(Vec2D p) Method parameters in toxi.physics2d with type arguments of type Vec2DConstructors in toxi.physics2d with parameters of type Vec2DModifierConstructorDescriptionParticleString2D(VerletPhysics2D physics, Vec2D pos, Vec2D step, int num, float mass, float strength) Creates a number of particles along a line and connects them into a string using springs.VerletPhysics2D(Vec2D gravity, int numIterations, float drag, float timeStep) Initializes an Verlet engine instance with the passed in configuration.Constructor parameters in toxi.physics2d with type arguments of type Vec2D -
Uses of Vec2D in toxi.physics2d.behaviors
Methods in toxi.physics2d.behaviors that return Vec2DModifier and TypeMethodDescriptionAttractionBehavior2D.getAttractor()ConstantForceBehavior2D.getForce()Methods in toxi.physics2d.behaviors with parameters of type Vec2DModifier and TypeMethodDescriptionvoidAttractionBehavior2D.setAttractor(Vec2D attractor) voidvoidMethod parameters in toxi.physics2d.behaviors with type arguments of type Vec2DModifier and TypeMethodDescriptionvoidAttractionBehavior2D.applyWithIndex(SpatialIndex<Vec2D> spaceHash) voidConstantForceBehavior2D.applyWithIndex(SpatialIndex<Vec2D> spaceHash) voidParticleBehavior2D.applyWithIndex(SpatialIndex<Vec2D> index) Constructors in toxi.physics2d.behaviors with parameters of type Vec2DModifierConstructorDescriptionAttractionBehavior2D(Vec2D attractor, float radius, float strength) AttractionBehavior2D(Vec2D attractor, float radius, float strength, float jitter) ConstantForceBehavior2D(Vec2D force) GravityBehavior2D(Vec2D gravity) GravityBehavior2D(Vec2D gravity, float timeStep) -
Uses of Vec2D in toxi.physics2d.constraints
Fields in toxi.physics2d.constraints declared as Vec2DConstructors in toxi.physics2d.constraints with parameters of type Vec2DModifierConstructorDescriptionAngularConstraint(Vec2D p, int theta) CircularConstraint(Vec2D origin, float radius) RectConstraint(Vec2D min, Vec2D max) -
Uses of Vec2D in toxi.processing
Methods in toxi.processing with parameters of type Vec2DModifier and TypeMethodDescriptionfinal voidfinal voidfinal voidDraws a 2D point at the given position.final voidfinal voidfinal voidMethod parameters in toxi.processing with type arguments of type Vec2DModifier and TypeMethodDescriptionfinal voidToxiclibsSupport.lineStrip2D(List<? extends Vec2D> points) Draws a 2D line strip using all points in the given list of vectors.final voidToxiclibsSupport.lineStrip2D(List<? extends Vec2D> points, float scale) final voidfinal voidfinal voidfinal voidToxiclibsSupport.processVertices2D(Iterator<? extends Vec2D> iterator, int shapeID, boolean closed) final voidToxiclibsSupport.processVertices2D(Iterator<? extends Vec2D> iterator, int shapeID, boolean closed, float scale)