# InlineMath.h File Reference

## Defines
#define | macroAbsoluteValue(x) (((x) < 0) ? -(x) : (x))
#define | macroRoundedValue(a) floor((a)+0.5)
#define | macroSignOfValue(a) (((a)<0) ? -1 : (a)>0 ? 1 : 0)
#define | macroSquaredValue(a) ((a)*(a))
#define | macroLerp(kStart, kEnd, kInterpolant) ((kStart)+(((kEnd)-(kStart))*(kInterpolant)))
#define | macroVector2Op1(v1, op1, v2)
#define | macroVector2Op2(v1, op1, v2, op2, v3)
#define | macroVector2Op2Scalar(v1, op1, v2, op2, kScalar)
#define | macroVector2Op3Scalar(v1, op1, v2, op2, v3, op3, kScalar)
#define | macroVector3Op1(v1, op1, v2)
#define | macroVector3Op2(v1, op1, v2, op2, v3)
#define | macroVector3Op2Scalar(v1, op1, v2, op2, kScalar)
#define | macroVector3Op3Scalar(v1, op1, v2, op2, v3, op3, kScalar)
#define | macroVector4Op1(v1, op1, v2)
#define | macroVector4Op2(v1, op1, v2, op2, v3)
#define | macroVector4Op2Scalar(v1, op1, v2, op2, kScalar)
#define | macroVector4Op3Scalar(v1, op1, v2, op2, v3, op3, kScalar)
#define | macroMultiplyVector4ByAffineRowTfm(kV, kM, result)

## Define Documentation

#define macroAbsoluteValue | ( | x |  | ) | (((x) < 0) ? -(x) : (x))

#define macroLerp | ( | kStart,
|  | kEnd,
|  | kInterpolant |  | ) | ((kStart)+(((kEnd)-(kStart))*(kInterpolant)))

#define macroMultiplyVector4ByAffineRowTfm | ( | kV,
|  | kM,
|  | result |  | ) |

Value:

    {                                                                                                                                                                               \
                    (result).x = (kV)(0)*kM(0,0) + (kV)(1)*kM(1,0) + (kV)(2)*kM(2,0) + (kV)(3)*kM(3,0);     \
                    (result).y = (kV)(0)*kM(0,1) + (kV)(1)*kM(1,1) + (kV)(2)*kM(2,1) + (kV)(3)*kM(3,1);     \
                    (result).z = (kV)(0)*kM(0,2) + (kV)(1)*kM(1,2) + (kV)(2)*kM(2,2) + (kV)(3)*kM(3,2);     \
                    (result).w = (kV)(0)*kM(0,3) + (kV)(1)*kM(1,3) + (kV)(2)*kM(2,3) + (kV)(3)*kM(3,3);     \
            }

#define macroRoundedValue | ( | a |  | ) | floor((a)+0.5)

#define macroSignOfValue | ( | a |  | ) | (((a)<0) ? -1 : (a)>0 ? 1 : 0)

#define macroSquaredValue | ( | a |  | ) | ((a)*(a))

#define macroVector2Op1 | ( | v1,
|  | op1,
|  | v2 |  | ) |

Value:

    {                                                               \
                            v1.x op1 v2.x;                          \
                            v1.y op1 v2.y;                          \
                    }

#define macroVector2Op2 | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | v3 |  | ) |

Value:

    {                                                                               \
                            v1.x op1 v2.x op2 v3.x;                         \
                            v1.y op1 v2.y op2 v3.y;                         \
                    }

#define macroVector2Op2Scalar | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | kScalar |  | ) |

Value:

    {                                                                                                       \
                            v1.x op1 v2.x op2 kScalar;                                              \
                            v1.y op1 v2.y op2 kScalar;                                              \
                    }

#define macroVector2Op3Scalar | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | v3,
|  | op3,
|  | kScalar |  | ) |

Value:

    {                                                                                                                       \
                            v1.x op1 v2.x op2 v3.x op3 kScalar;                                             \
                            v1.y op1 v2.y op2 v3.y op3 kScalar;                                             \
                    }

#define macroVector3Op1 | ( | v1,
|  | op1,
|  | v2 |  | ) |

Value:

    {                                                               \
                            v1.x op1 v2.x;                          \
                            v1.y op1 v2.y;                          \
                            v1.z op1 v2.z;                          \
                    }

#define macroVector3Op2 | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | v3 |  | ) |

Value:

    {                                                                               \
                            v1.x op1 v2.x op2 v3.x;                         \
                            v1.y op1 v2.y op2 v3.y;                         \
                            v1.z op1 v2.z op2 v3.z;                         \
                    }

#define macroVector3Op2Scalar | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | kScalar |  | ) |

Value:

    {                                                                                                       \
                            v1.x op1 v2.x op2 kScalar;                                              \
                            v1.y op1 v2.y op2 kScalar;                                              \
                            v1.z op1 v2.z op2 kScalar;                                              \
                    }

#define macroVector3Op3Scalar | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | v3,
|  | op3,
|  | kScalar |  | ) |

Value:

    {                                                                                                                       \
                            v1.x op1 v2.x op2 v3.x op3 kScalar;                                             \
                            v1.y op1 v2.y op2 v3.y op3 kScalar;                                             \
                            v1.z op1 v2.z op2 v3.z op3 kScalar;                                             \
                    }

#define macroVector4Op1 | ( | v1,
|  | op1,
|  | v2 |  | ) |

Value:

    {                                                               \
                            v1.x op1 v2.x;                          \
                            v1.y op1 v2.y;                          \
                            v1.z op1 v2.z;                          \
                            v1.w op1 v2.w;                          \
                    }

#define macroVector4Op2 | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | v3 |  | ) |

Value:

    {                                                                               \
                            v1.x op1 v2.x op2 v3.x;                         \
                            v1.y op1 v2.y op2 v3.y;                         \
                            v1.z op1 v2.z op2 v3.z;                         \
                            v1.w op1 v2.w op2 v3.w;                         \
                    }

#define macroVector4Op2Scalar | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | kScalar |  | ) |

Value:

    {                                                                               \
                            v1.x op1 v2.x op2 kScalar;                      \
                            v1.y op1 v2.y op2 kScalar;                      \
                            v1.z op1 v2.z op2 kScalar;                      \
                            v1.w op1 v2.w op2 kScalar;                      \
                    }

#define macroVector4Op3Scalar | ( | v1,
|  | op1,
|  | v2,
|  | op2,
|  | v3,
|  | op3,
|  | kScalar |  | ) |

Value:

    {                                                                                                                       \
                            v1.x op1 v2.x op2 v3.x op3 kScalar;                                             \
                            v1.y op1 v2.y op2 v3.y op3 kScalar;                                             \
                            v1.z op1 v2.z op2 v3.z op3 kScalar;                                             \
                            v1.w op1 v2.w op2 v3.w op3 kScalar;                                             \
                    }