Ejemplo n.º 1
0
/**
 * 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;
}
Ejemplo n.º 2
0
//
// 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)
Ejemplo n.º 3
0
void Point::setAngle(const F32 ang)
{
   setPolar(len(), ang);
}
Ejemplo n.º 4
0
void ComplexFloatArray::setPolar(FloatArray magnitude, FloatArray phase){
  setPolar(magnitude, phase, 0, size);
}
Ejemplo n.º 5
0
//
// 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)
Ejemplo n.º 6
0
/**
 * Sets the vector magnitude without chaning the direction.
 */
void RVector::setMagnitude2D(double m) {
    double a = getAngle();
    setPolar(m, a);
}