* coordinateSystem - create a local coordinate system relative to global coordinate system (0, 0, 0) * toLocal - transforms a set of points (x, y, z) from global coordinate system to local coordinate system * toGlobal - transforms a set of points (x, y, z) from local coordinate system to global coordinate system
* origin - a 1x3 array defining coordinate system offset (X, Y, Z) from global coordinate systemLanguage * rotation - a 3x3 transformation (rotation) matrix defining local coordinate system axes relative to global coordinate system
An airplane is flying thru the air. Its true air speed is 86 knots, with 4 degrees angle of attack and 2 degrees side slip angle. its pitch is 12 degrees, roll if 35 degrees and it is headed on bearing 125 degrees. what is its air speed in body and earth (inertial) coordinate system?
// information var airSpeed = 86, alpha = 4, beta = 2, pitch = 12, roll = 35, yaw = 125; // define a coordinate system in which airplane body is global and measurements are local var bodyWindCS = new coordinateSystem([0, 0, 0], alpha, 0, beta); // airspeed in body coordinate system var airspeedBody = bodyWindCS.toGlobal([86, 0, 0]); // define airplane body coordinate system relative to earth (inertial) var bodyEarthCS = new coordinateSystem([0, 0, 0], pitch, roll ,yaw); // airspeed in earth coordinate system var airspeedEarth = bodyEarthCS.toGlobal(airspeedBody);