/** * Mirrors this vector at the given axis. */ RVector RVector::mirror(const RLine& axis) { double phi1 = axis.startPoint.getAngleTo(*this); double phi2 = axis.startPoint.getAngleTo(axis.endPoint) - phi1; double r1 = axis.startPoint.getDistanceTo(*this); double r2 = axis.endPoint.getDistanceTo(*this); if (r1 < 1.0e-6 || r2 < 1.0e-6) { // point touches one axis point } else { setPolar(r1, phi1 + 2* phi2 ); (*this) += axis.startPoint; } return *this; }
// // bool setAngle(theta) // Last modified: 07Nov2009 // // Attempts to set the angle to the parameterized angle, // returning true if successful, false otherwise. // // Returns: true if successful, false otherwise // Parameters: // theta in the angle to be set to (default 0) // bool Vector::setAngle(const GLfloat theta) { return setPolar(magnitude(), theta); } // setAngleconst GLfloat)
void Point::setAngle(const F32 ang) { setPolar(len(), ang); }
void ComplexFloatArray::setPolar(FloatArray magnitude, FloatArray phase){ setPolar(magnitude, phase, 0, size); }
// // bool setAngle(theta) // Last modified: 04Sep2006 // // Attempts to set the angle to the parameterized angle, // returning true if successful, false otherwise. // // Returns: true if successful, false otherwise // Parameters: // theta in the angle to be set to (default 0) // bool Vector::setAngle(const GLfloat theta) { return setPolar(norm(), theta); } // setAngleconst GLfloat)
/** * Sets the vector magnitude without chaning the direction. */ void RVector::setMagnitude2D(double m) { double a = getAngle(); setPolar(m, a); }