This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofMath.h
Go to the documentation of this file.
106[[deprecated("use ofSetRandomSeed() or of::random::seed() instead")]] void ofSeedRandom(int val);
157float ofMap(float value, float inputMin, float inputMax, float outputMin, float outputMax, bool clamp = false);
443bool ofLineSegmentIntersection(const vectype& line1Start, const vectype& line1End, const vectype& line2Start, const vectype& line2End, vectype& intersection){
539Type ofInterpolateCubic(const Type& y0, const Type& y1, const Type& y2, const Type& y3, float pct);
541Type ofInterpolateCatmullRom(const Type& y0, const Type& y1, const Type& y2, const Type& y3, float pct);
543Type ofInterpolateHermite(const Type& y0, const Type& y1, const Type& y2, const Type& y3, float pct);
545Type ofInterpolateHermite(const Type& y0, const Type& y1, const Type& y2, const Type& y3, float pct, float tension, float bias);
591typename std::enable_if<std::is_floating_point<Type>::value, bool>::type ofIsFloatEqual(const Type& a, const Type& b)
614Type ofInterpolateCubic(const Type& y0, const Type& y1, const Type& y2, const Type& y3, float pct){
630Type ofInterpolateCatmullRom(const Type& y0, const Type& y1, const Type& y2, const Type& y3, float pct){
644inline Type ofInterpolateHermite(const Type& y0, const Type& y1, const Type& y2, const Type& y3, float pct){
657Type ofInterpolateHermite(const Type& y0, const Type& y1, const Type& y2, const Type& y3, float pct, float tension, float bias){
vectype ofCurvePoint(const vectype &a, const vectype &b, const vectype &c, const vectype &d, float t)
Given the four points that determine a Catmull Rom curve, return an interpolated point on the curve.
Definition ofMath.h:493
void ofSeedRandom()
Seeds the random number generator with a unique value.
Definition ofMath.cpp:19
float ofAngleDifferenceRadians(float currentAngle, float targetAngle)
Calculates the difference between two angles in radians.
Definition ofMath.cpp:258
float ofWrap(float value, float from, float to)
Find a value within a given range, wrapping the value if it overflows.
Definition ofMath.cpp:151
void ofSetRandomSeed(unsigned long new_seed)
Seed the random number generator.
Definition ofMath.cpp:38
float ofSignedNoise(float x)
Calculates a one dimensional Perlin noise value between -1.0...1.0.
Definition ofMath.cpp:218
vectype ofBezierTangent(const vectype &a, const vectype &b, const vectype &c, const vectype &d, float t)
Definition ofMath.h:517
Type ofInterpolateCatmullRom(const Type &y0, const Type &y1, const Type &y2, const Type &y3, float pct)
Definition ofMath.h:630
float ofWrapRadians(float angle, float from=-glm::pi< float >(), float to=glm::pi< float >())
Definition ofMath.cpp:164
vectype ofCurveTangent(const vectype &a, const vectype &b, const vectype &c, const vectype &d, float t)
Return a tangent point for an offset along a Catmull Rom curve.
Definition ofMath.h:529
float ofWrapDegrees(float angle, float from=-180, float to=+180)
Definition ofMath.cpp:168
float ofLerpDegrees(float currentAngle, float targetAngle, float pct)
Linearly interpolate a value between two angles in degrees.
Definition ofMath.cpp:173
float ofClamp(float value, float min, float max)
Clamp a value between min and max.
Definition ofMath.cpp:120
Type ofInterpolateHermite(const Type &y0, const Type &y1, const Type &y2, const Type &y3, float pct)
Definition ofMath.h:644
bool ofLineSegmentIntersection(const vectype &line1Start, const vectype &line1End, const vectype &line2Start, const vectype &line2End, vectype &intersection)
Determine the intersection between two lines.
Definition ofMath.h:443
float ofLerp(float start, float stop, float amt)
Linearly interpolate a value within a range.
Definition ofMath.cpp:147
float ofAngleDifferenceDegrees(float currentAngle, float targetAngle)
Calculates the difference between two angles in degrees.
Definition ofMath.cpp:253
float ofNoise(float x)
Calculates a one dimensional Perlin noise value between 0.0...1.0.
Definition ofMath.cpp:183
float ofRandomWidth()
Get a random floating point number between 0 and the screen width.
Definition ofAppRunner.cpp:444
bool ofInRange(float t, float min, float max)
Determine if a number is inside of a giv(float)(en range.
Definition ofMath.cpp:132
float ofDist(float x1, float y1, float x2, float y2)
Calculates the 2D distance between two points.
Definition ofMath.cpp:100
float ofRandomHeight()
Get a random floating point number between 0 and the screen height.
Definition ofAppRunner.cpp:449
Type ofInterpolateCosine(const Type &y1, const Type &y2, float pct)
Definition ofMath.h:604
float ofDistSquared(float x1, float y1, float x2, float y2)
Calculates the squared 2D distance between two points.
Definition ofMath.cpp:110
vectype ofBezierPoint(const vectype &a, const vectype &b, const vectype &c, const vectype &d, float t)
Given the four points that determine a bezier curve, return an interpolated point on the curve.
Definition ofMath.h:480
std::enable_if< std::is_floating_point< Type >::value, bool >::type ofIsFloatEqual(const Type &a, const Type &b)
Compare two floating point types for equality.
Definition ofMath.h:591
float ofLerpRadians(float currentAngle, float targetAngle, float pct)
Linearly interpolate a value between two angles in radians.
Definition ofMath.cpp:178
Type ofInterpolateCubic(const Type &y0, const Type &y1, const Type &y2, const Type &y3, float pct)
Definition ofMath.h:614
float ofRandom(float max)
Get a random floating point number between 0 and max.
Definition ofMath.cpp:47
float ofMap(float value, float inputMin, float inputMax, float outputMin, float outputMax, bool clamp=false)
Given a value and an input range, map the value to an output range.
Definition ofMath.cpp:78
float ofNormalize(float value, float min, float max)
Given a value and an input range, map the value to be within 0 and 1.
Definition ofMath.cpp:72
#define d
#define a
#define c
#define b