This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofVec2f.h
Go to the documentation of this file.
942 OF_DEPRECATED_MSG("Use member method getScaled() instead.", ofVec2f rescaled( const float length ) const);
945 OF_DEPRECATED_MSG("Use member method scale() instead.", ofVec2f& rescale( const float length ));
948 OF_DEPRECATED_MSG("Use member method getRotated() instead.", ofVec2f rotated( float angle ) const);
957 OF_DEPRECATED_MSG("Use member method getPerpendicular() instead.", ofVec2f perpendiculared() const);
960 OF_DEPRECATED_MSG("Use member method getInterpolated() instead.", ofVec2f interpolated( const ofVec2f& pnt, float p ) const);
963 OF_DEPRECATED_MSG("Use member method getMiddled() instead.", ofVec2f middled( const ofVec2f& pnt ) const);
966 OF_DEPRECATED_MSG("Use member method getMapped() instead.", ofVec2f mapped( const ofVec2f& origin, const ofVec2f& vx, const ofVec2f& vy ) const);
969 OF_DEPRECATED_MSG("Use member method squareDistance() instead.", float distanceSquared( const ofVec2f& pnt ) const);
972 OF_DEPRECATED_MSG("Use member method getRotated() instead.", ofVec2f rotated( float angle, const ofVec2f& pivot ) const);
ofVec2f & operator-=(const ofVec2f &vec)
Super easy subtraction assignment. Subtracts vec.x from x, and subtracts vec.y from y.
ofVec2f & operator+=(const ofVec2f &vec)
Super easy addition assignment. Adds vec.x to x, and adds vec.y to y.
ofVec2f & rotateRad(float angle)
Rotates this vector by 'angle' radians about the origin.
ofVec2f & operator*=(const ofVec2f &vec)
Multiplies x by vec.x, and multiplies y by vec.y.
bool align(const ofVec2f &vec, float tolerance=0.0001f) const
Determine if two vectors are aligned.
float lengthSquared() const
Return the squared length (squared magnitude) of this vector.
ofVec2f getRotatedRad(float angle) const
Returns a new vector that is the result of rotating this vector by 'angle' radians about the origin.
ofVec2f getRotatedRad(float angle, const ofVec2f &pivot) const
Returns a new vector that is the result of rotating this vector by 'angle' radians about the origin.
ofVec2f operator*(const ofVec2f &vec) const
Returns a new vector (x*vec.x , y*vec.y).
ofVec2f & average(const ofVec2f *points, std::size_t num)
Average vector over an array of points.
ofVec2f & rotate(float angle)
Rotates this vector by 'angle' degrees about the origin.
ofVec2f & perpendicular()
Set this vector to its own normalized perpendicular (by rotating 90 degrees and normalizing).
ofVec2f operator/(const float f) const
Return a new ofVec2f that is this vector scaled by dividing both x and y members by f.
ofVec2f operator-() const
Returns a new ofVec2f that is the inverted version (mirrored in X and Y) of this vector.
ofVec2f operator+(const float f) const
Returns a new vector with a float value f added to both x and y members.
ofVec2f getMapped(const ofVec2f &origin, const ofVec2f &vx, const ofVec2f &vy) const
Get vector mapped to new coordinate system.
void set(const ofVec2f &vec)
Set the x and y components of this vector by copying the corresponding values from vec.
ofVec2f getPerpendicular() const
Return the normalized ofVec2f that is perpendicular to this vector (ie rotated 90 degrees and normali...
ofVec2f & operator*=(const float f)
Scale this vector by multiplying both x and y members by f.
ofVec2f operator*(const float f) const
Return a new ofVec2f that is this vector scaled by multiplying both x and y members by the float.
ofVec2f getMiddle(const ofVec2f &pnt) const
Calculate and return the midpoint between this vector and pnt.
ofVec2f & rotate(float angle, const ofVec2f &pivot)
Rotates this vector by 'angle' degrees about the point 'pivot'.
void set(float x, float y)
Set x and y components of this vector with just one function call.
float * getPtr()
Returns a pointer to the memory position of the first element of the vector (x); the second element (...
Definition ofVec2f.h:159
ofVec2f operator+(const ofVec2f &vec) const
Super easy vector addition. Returns a new vector (x+vec.x,y+vec.y).
bool isAlignedRad(const ofVec2f &vec, float tolerance=0.0001f) const
Determine if two vectors are aligned with tolerance in radians.
ofVec2f & operator/=(const float f)
Scale this vector by dividing both x and y members by f.
ofVec2f & scale(const float length)
Scales this vector up or down so that it has the requested length.
bool match(const ofVec2f &vec, float tolerance=0.0001f) const
Returns true if each component is close enough to its corresponding component in vec,...
ofVec2f & middle(const ofVec2f &pnt)
Set this vector to the midpoint between itself and pnt.
ofVec2f getInterpolated(const ofVec2f &pnt, float p) const
Linear interpolation.
ofVec2f & operator/=(const ofVec2f &vec)
Divides x by vec.x, and divides y by vec.y.
bool isAligned(const ofVec2f &vec, float tolerance=0.0001f) const
Determine if two vectors are aligned.
bool operator!=(const ofVec2f &vec) const
Check for inequality between two ofVec2f.
bool alignRad(const ofVec2f &vec, float tolerance=0.0001f) const
Determine if two vectors are aligned with tolerance in radians.
ofVec2f & operator-=(const float f)
Subtract a float value f from both x and y members.
ofVec2f & rotateRad(float angle, const ofVec2f &pivot)
Rotates this vector by 'angle' radians about the point 'pivot'.
float angle(const ofVec2f &vec) const
Calculate the angle to another vector in degrees.
ofVec2f getRotated(float angle) const
Returns a new vector that is the result of rotating this vector by 'angle' degrees about the origin.
ofVec2f(const glm::vec2 &v)
ofVec2f operator-(const ofVec2f &vec) const
Super easy vector subtraction. Returns a new vector (x-vec.x,y-vec.y).
ofVec2f operator/(const ofVec2f &vec) const
Returns a new vector (x/vec.x,y/vec.y).
ofVec2f getScaled(const float length) const
ofVec2f & limit(float max)
Restrict the length (magnitude) of this vector to a maximum of max units by scaling down if necessary...
ofVec2f operator-(const float f) const
Returns a new vector with a float value f subtracted from both x and y members.
float & operator[](int n)
Allows to access the x and y components of an ofVec2f as though it is an array.
Definition ofVec2f.h:177
ofVec2f & map(const ofVec2f &origin, const ofVec2f &vx, const ofVec2f &vy)
Maps this vector from its default coordinate system – origin (0,0), X direction (1,...
void set(float scalar)
float angleRad(const ofVec2f &vec) const
Calculate the angle to another vector in radians.
float squareDistance(const ofVec2f &pnt) const
Distance between two points squared.
ofVec2f getRotated(float angle, const ofVec2f &pivot) const
Returns a new vector that is the result of rotating this vector by 'angle' degrees about the point 'p...
Definition ofVec4f.h:11
std::ostream & operator<<(std::ostream &os, const ofMatrix3x3 &M)
Definition ofMatrix3x3.cpp:304
#define a