PointF



This union represents pair of floating point values.

You can find more information in comments below.

union PointF
{
    struct
    {
        float X;
        float Y;
    };
    float Data[2];

    float operator[](const int index) const; // Get element
    float &operator[](const int index); // Get element
};

Following operators are also available.

PointF operator+(const PointF &a, const float value); // Add point and value
PointF operator-(const PointF &a, const float value); // Subtract point and value
PointF operator/(const PointF &a, const float value); // Divide point and value
PointF operator*(const PointF &a, const float value); // Multiply point and value
PointF operator+(const float value, const PointF &a); // Add value and point
PointF operator-(const float value, const PointF &a); // Subtract value and point
PointF operator/(const float value, const PointF &a); // Divide value and point
PointF operator*(const float value, const PointF &a); // Multiply value and point
PointF &operator+=(PointF &a, const float value); // Add value to point
PointF &operator-=(PointF &a, const float value); // Subtract value from point
PointF &operator/=(PointF &a, const float value); // Divide point on value
PointF &operator*=(PointF &a, const float value); // Multiply point on value
PointF operator+(const PointF &a, const PointF &b); // Add points elements
PointF operator-(const PointF &a, const PointF &b); // Subtract points elements
PointF operator*(const PointF &a, const PointF &b); // Multiply point elements
PointF operator/(const PointF &a, const PointF &b); // Divide point elements
PointF &operator+=(PointF &a, const PointF &b); // Add elements of another point to first one
PointF &operator-=(PointF &a, const PointF &b); // Subtract elements of another point from first one
PointF &operator*=(PointF &a, const PointF &b); // Multiply point element to elements of another point
PointF &operator/=(PointF &a, const PointF &b); // Divide point element on elements of another point
std::wostream &operator<<(std::wostream &stream, const PointF &a); // Output as source code
Namespace: nitisa
Include: Nitisa/Core/MathPointF.h (For union declaration)
Nitisa/Core/MathPointFUtils.h (For standalone operators)