R2Vector 
operator/(const R2Vector& vector, double a)
{
  assert(a != 0);
  return R2Vector(vector.X() / a, 
                  vector.Y() / a);
}
Exemple #2
0
void R3Matrix:: 
Scale(const R2Vector& scale)
{
    // Scale matrix
    XScale(scale.X());
    YScale(scale.Y());
}
Exemple #3
0
void R3Matrix:: 
Translate(const R2Vector& offset)
{
    // Translate matrix
    XTranslate(offset.X());
    YTranslate(offset.Y());
}
Exemple #4
0
R2Vector
operator*(const R3Matrix& a, const R2Vector& v)
{
    // Multiply matrix by vector
    RNCoord x = a.m[0][0] * v.X() + a.m[0][1] * v.Y();
    RNCoord y = a.m[1][0] * v.X() + a.m[1][1] * v.Y();
    return R2Vector(x, y);
}
Exemple #5
0
R2Point 
operator-(const R2Point& point, const R2Vector& vector)
{
    return R2Point(point.X() - vector.X(), 
		   point.Y() - vector.Y());
}
R2Halfspace::
R2Halfspace(const R2Point& point, const R2Vector& normal)
    : line(point, R2Vector(-normal.Y(), normal.X()))
{
}
Exemple #7
0
double operator%(const R2Vector& vector1, const R2Vector& vector2)
{
    // Return cross product
    return vector1.X()*vector2.Y() - vector1.Y()*vector2.X();
}
Exemple #8
0
R2Vector operator*(const R2Vector& vector, double a)
{
    return R2Vector(vector.X() * a, 
            vector.Y() * a);
}
Exemple #9
0
R2Vector operator-(const R2Vector& vector)
{
    return R2Vector(-vector.X(), 
            -vector.Y());
}