| Syntax C/C++ | #include <VFmath.h>
void VF_rotateCoordinates( fVector Xrot, fVector Yrot, fVector X, fVector Y, ui size, float costheta, float sintheta );
void VCF_rotateCoordinates( cfVector XYrot, cfVector XY, ui size, float costheta, float sintheta ); |
| C++ VecObj | #include <OptiVec.h>
void vector<T>::rotateCoordinates( const vector<T>& Yrot, const vector<T>& X,const vector<T>& Y, T costheta, T sintheta );
void vector<complex<T> >::rotateCoordinates( const vector<complex<T> >& XY, T costheta, T sintheta ); |
| Pascal/Delphi | uses VFmath;
procedure VF_rotateCoordinates( Xrot, Yrot, X, Y:fVector; size:UIntSize; costheta, sintheta:Single );
procedure VCF_rotateCoordinates( XYrot, XY:cfVector; size:UIntSize; costheta, sintheta:Single ); |
|
| Beschreibung | Die entweder in dem reellen Vektorpaar X,Y oder in dem komplexen Vektor XY an die Funktion übergebenen Koordinaten werden entgegen dem Uhrzeigersinn um den Winkel theta gedreht. Dabei wird theta nicht selbst angegeben, sondern über seinen Cosinus und Sinus spezifiziert, also als costheta und sintheta:
Xroti = cos(theta) * Xi - sin(theta) * Yi,
Yroti = sin(theta) * Xi + cos(theta) * Yi
Das Ergebnis kann mit einem konstanten Faktor skaliert werden. Hierzu multipliziere man einfach costheta und sintheta mit dem gewünschten Skalierungsfaktor. Diese Funktion läßt sich auch für Berechnungen nach analogen Formeln einsetzen, d.h. costheta und sintheta müssen nicht einem tatsächlichen Drehwinkel entsprechen. |
|