Vuo  2.3.1
Macros | Typedefs | Functions

Description

A floating-point number.

Macros

#define VuoReal_SUPPORTS_COMPARISON
 This type has _areEqual() and _isLessThan() functions. More...
 

Typedefs

typedef double VuoReal
 A floating-point number. More...
 

Functions

VuoReal VuoReal_makeFromJson (json_object *js)
 Decodes the JSON object js to create a new value. More...
 
json_objectVuoReal_getJson (const VuoReal value)
 Encodes value as a JSON object. More...
 
char * VuoReal_getSummary (const VuoReal value)
 Returns a string representation of value (either decimal or scientific notation, whichever is shorter). More...
 
VuoReal VuoReal_minList (VuoList_VuoReal values, VuoInteger *outputPosition)
 Returns the minimum of a list of terms, or 0 if the array is empty. More...
 
VuoReal VuoReal_maxList (VuoList_VuoReal values, VuoInteger *outputPosition)
 Returns the maximum of a list of terms, or 0 if the array is empty. More...
 
VuoReal VuoReal_average (VuoList_VuoReal values)
 Returns the average of the values in the list, or 0 if the list is empty. More...
 
VuoReal VuoReal_wrap (VuoReal value, VuoReal minimum, VuoReal maximum)
 Returns value if it is within the range of minimum (inclusive) to maximum (exclusive), otherwise a value wrapped with modular arithmetic to be within the range. More...
 
VuoReal VuoReal_random (const VuoReal minimum, const VuoReal maximum)
 Returns a pseudorandom value between minimum and maximum. More...
 
VuoReal VuoReal_randomWithState (unsigned short state[3], const VuoReal minimum, const VuoReal maximum)
 Returns a pseudorandom value between minimum and maximum. More...
 
static VuoReal VuoReal_add (VuoReal a, VuoReal b) __attribute__((const))
 a+b More...
 
static VuoReal VuoReal_subtract (VuoReal a, VuoReal b) __attribute__((const))
 a-b More...
 
static VuoReal VuoReal_multiply (VuoReal a, VuoReal b) __attribute__((const))
 a*b More...
 
static VuoReal VuoReal_scale (VuoReal a, VuoReal b) __attribute__((const))
 Same as VuoReal_multiply. More...
 
static VuoReal VuoReal_divide (VuoReal a, VuoReal b) __attribute__((const))
 a/b More...
 
static VuoReal VuoReal_makeNonzero (VuoReal a) __attribute__((const))
 If the value is zero or very close to zero, moves the value further from zero (either 0.000001 or -0.000001). More...
 
static VuoReal VuoReal_distance (VuoReal a, VuoReal b) __attribute__((const))
 Distance between a and b. More...
 
static VuoReal VuoReal_lerp (VuoReal a, VuoReal b, float t) __attribute__((const))
 Returns a linearly interpolated value between a and b using time t. More...
 
static VuoReal VuoReal_spring (VuoReal timeSinceDrop, VuoReal dropPosition, VuoReal restingPosition, VuoReal period, VuoReal damping)
 Calculates a position along the path of an oscillating spring. More...
 
static VuoReal VuoReal_clamp (VuoReal value, VuoReal limitA, VuoReal limitB)
 Limits value to values between limitA and limitB, inclusive. More...
 
static VuoReal VuoReal_clampn (VuoReal value, VuoReal limitA, VuoReal limitB)
 Same as VuoReal_clamp. More...
 
static VuoReal VuoReal_bezier3 (VuoReal p0, VuoReal p1, VuoReal p2, VuoReal p3, VuoReal time)
 Calculates a position along a cubic bezier curve. More...
 
static VuoReal VuoReal_snap (VuoReal a, VuoReal center, VuoReal snap)
 Snap value a to the nearest increment of value snap. More...
 
bool VuoReal_areEqual (const VuoReal value1, const VuoReal value2)
 Returns true if the two values are equal (within a small tolerance). More...
 
bool VuoReal_areEqualListWithinTolerance (VuoList_VuoReal values, VuoReal tolerance)
 Returns true if the two values are equal within tolerance. More...
 
bool VuoReal_isLessThan (const VuoReal a, const VuoReal b)
 Returns true if a < b. More...
 
bool VuoReal_isWithinRange (VuoReal value, VuoReal minimum, VuoReal maximum)
 Returns true if value is between minimum and maximum. More...
 
VuoReal VuoReal_makeFromString (const char *str)
 Automatically generated function. More...
 
char * VuoReal_getString (const VuoReal value)
 Automatically generated function. More...
 
void VuoReal_retain (VuoReal value)
 Automatically generated function. More...
 
void VuoReal_release (VuoReal value)
 Automatically generated function. More...
 

Macro Definition Documentation

◆ VuoReal_SUPPORTS_COMPARISON

#define VuoReal_SUPPORTS_COMPARISON

This type has _areEqual() and _isLessThan() functions.

Definition at line 214 of file VuoReal.h.

Typedef Documentation

◆ VuoReal

typedef double VuoReal

A floating-point number.

Definition at line 37 of file VuoReal.h.

Function Documentation

◆ VuoReal_add()

static VuoReal VuoReal_add ( VuoReal  a,
VuoReal  b 
) const
inlinestatic

a+b

Provided for generic type equivalence with VuoPoints.

Definition at line 68 of file VuoReal.h.

◆ VuoReal_areEqual()

bool VuoReal_areEqual ( const VuoReal  value1,
const VuoReal  value2 
)

Returns true if the two values are equal (within a small tolerance).

Definition at line 195 of file VuoReal.c.

◆ VuoReal_areEqualListWithinTolerance()

bool VuoReal_areEqualListWithinTolerance ( VuoList_VuoReal  values,
VuoReal  tolerance 
)

Returns true if the two values are equal within tolerance.

Definition at line 210 of file VuoReal.c.

◆ VuoReal_average()

VuoReal VuoReal_average ( VuoList_VuoReal  values)

Returns the average of the values in the list, or 0 if the list is empty.

Definition at line 138 of file VuoReal.c.

◆ VuoReal_bezier3()

static VuoReal VuoReal_bezier3 ( VuoReal  p0,
VuoReal  p1,
VuoReal  p2,
VuoReal  p3,
VuoReal  time 
)
inlinestatic

Calculates a position along a cubic bezier curve.

Parameters
p0The curve's starting position.
p1The control point for the curve's starting position.
p2The control point for the curve's ending position.
p3The curve's ending position.
timeWhich value along the curve should be returned. 0 = starting position, 1 = ending position.

Definition at line 199 of file VuoReal.h.

◆ VuoReal_clamp()

static VuoReal VuoReal_clamp ( VuoReal  value,
VuoReal  limitA,
VuoReal  limitB 
)
inlinestatic

Limits value to values between limitA and limitB, inclusive.

The limits can be in either order: (min,max) or (max,min).

Definition at line 176 of file VuoReal.h.

◆ VuoReal_clampn()

static VuoReal VuoReal_clampn ( VuoReal  value,
VuoReal  limitA,
VuoReal  limitB 
)
inlinestatic

Same as VuoReal_clamp.

Provided for generic type compatibility with other _clampn functions.

Definition at line 185 of file VuoReal.h.

◆ VuoReal_distance()

static VuoReal VuoReal_distance ( VuoReal  a,
VuoReal  b 
) const
inlinestatic

Distance between a and b.

Definition at line 132 of file VuoReal.h.

◆ VuoReal_divide()

static VuoReal VuoReal_divide ( VuoReal  a,
VuoReal  b 
) const
inlinestatic

a/b

Provided for generic type equivalence with VuoPoints.

Definition at line 112 of file VuoReal.h.

◆ VuoReal_getJson()

struct json_object * VuoReal_getJson ( const VuoReal  value)

Encodes value as a JSON object.

Definition at line 60 of file VuoReal.c.

◆ VuoReal_getString()

char* VuoReal_getString ( const VuoReal  value)

Automatically generated function.

◆ VuoReal_getSummary()

char * VuoReal_getSummary ( const VuoReal  value)

Returns a string representation of value (either decimal or scientific notation, whichever is shorter).

Definition at line 81 of file VuoReal.c.

◆ VuoReal_isLessThan()

bool VuoReal_isLessThan ( const VuoReal  a,
const VuoReal  b 
)

Returns true if a < b.

Definition at line 230 of file VuoReal.c.

◆ VuoReal_isWithinRange()

bool VuoReal_isWithinRange ( VuoReal  value,
VuoReal  minimum,
VuoReal  maximum 
)

Returns true if value is between minimum and maximum.

Definition at line 238 of file VuoReal.c.

◆ VuoReal_lerp()

static VuoReal VuoReal_lerp ( VuoReal  a,
VuoReal  b,
float  t 
) const
inlinestatic

Returns a linearly interpolated value between a and b using time t.

t is between 0 and 1.

Definition at line 141 of file VuoReal.h.

◆ VuoReal_makeFromJson()

VuoReal VuoReal_makeFromJson ( json_object js)

Decodes the JSON object js to create a new value.

Definition at line 33 of file VuoReal.c.

◆ VuoReal_makeFromString()

VuoReal VuoReal_makeFromString ( const char *  str)

Automatically generated function.

◆ VuoReal_makeNonzero()

static VuoReal VuoReal_makeNonzero ( VuoReal  a) const
inlinestatic

If the value is zero or very close to zero, moves the value further from zero (either 0.000001 or -0.000001).

Definition at line 121 of file VuoReal.h.

◆ VuoReal_maxList()

VuoReal VuoReal_maxList ( VuoList_VuoReal  values,
VuoInteger outputPosition 
)

Returns the maximum of a list of terms, or 0 if the array is empty.

Definition at line 114 of file VuoReal.c.

◆ VuoReal_minList()

VuoReal VuoReal_minList ( VuoList_VuoReal  values,
VuoInteger outputPosition 
)

Returns the minimum of a list of terms, or 0 if the array is empty.

Definition at line 90 of file VuoReal.c.

◆ VuoReal_multiply()

static VuoReal VuoReal_multiply ( VuoReal  a,
VuoReal  b 
) const
inlinestatic

a*b

Provided for generic type equivalence with VuoPoints.

Definition at line 90 of file VuoReal.h.

◆ VuoReal_random()

VuoReal VuoReal_random ( const VuoReal  minimum,
const VuoReal  maximum 
)

Returns a pseudorandom value between minimum and maximum.

See also
VuoInteger_random

Definition at line 177 of file VuoReal.c.

◆ VuoReal_randomWithState()

VuoReal VuoReal_randomWithState ( unsigned short  state[3],
const VuoReal  minimum,
const VuoReal  maximum 
)

Returns a pseudorandom value between minimum and maximum.

See also
VuoInteger_randomWithState

Definition at line 187 of file VuoReal.c.

◆ VuoReal_release()

void VuoReal_release ( VuoReal  value)

Automatically generated function.

◆ VuoReal_retain()

void VuoReal_retain ( VuoReal  value)

Automatically generated function.

◆ VuoReal_scale()

static VuoReal VuoReal_scale ( VuoReal  a,
VuoReal  b 
) const
inlinestatic

Same as VuoReal_multiply.

Provided for generic type equivalence with VuoPoints.

Definition at line 101 of file VuoReal.h.

◆ VuoReal_snap()

static VuoReal VuoReal_snap ( VuoReal  a,
VuoReal  center,
VuoReal  snap 
)
inlinestatic

Snap value a to the nearest increment of value snap.

Definition at line 207 of file VuoReal.h.

◆ VuoReal_spring()

static VuoReal VuoReal_spring ( VuoReal  timeSinceDrop,
VuoReal  dropPosition,
VuoReal  restingPosition,
VuoReal  period,
VuoReal  damping 
)
inlinestatic

Calculates a position along the path of an oscillating spring.

Definition at line 149 of file VuoReal.h.

◆ VuoReal_subtract()

static VuoReal VuoReal_subtract ( VuoReal  a,
VuoReal  b 
) const
inlinestatic

a-b

Provided for generic type equivalence with VuoPoints.

Definition at line 79 of file VuoReal.h.

◆ VuoReal_wrap()

VuoReal VuoReal_wrap ( VuoReal  value,
VuoReal  minimum,
VuoReal  maximum 
)

Returns value if it is within the range of minimum (inclusive) to maximum (exclusive), otherwise a value wrapped with modular arithmetic to be within the range.

Changed in Vuo 2.0.0:
Made minimum inclusive and maximum exclusive.

Definition at line 157 of file VuoReal.c.