math - Given vector of one axis, how do I find vectors of other two axes? -


This is the problem of mathematics. I am not sure how to do that there is no alliance with the vector axis, so X, Y Or rotating around 90 degrees of Z, I will not necessarily need other axes.

I can think of a few different scenarios you can ask.


Given: A pre-existing coordinate system

  • In 2D systems, your axis / base is always < Code> [1,0] and [0,1] - x and y axis

  • In a 3D system, your axis / base is always [1, 0,0] , [0,1,0] , and [0,0,1] - x , y , and z .


Given: An axis-coordinate system in an axial-base 2D

If you have an arbitrary -The base is an axis in the 2D coordinate system, then the other axis is orthogonal vector.

x_new, y_new] = [-y_old, x_old] clockwise :

To rotate a vector orthogonically, To summarize: x-axis = [a, b] then: y-axis = [-b, a] given: y-axis = [c, d] then: X axis = [d, -c]


given: Two axes in an elite-base 3D coordinate system

< P> To do this, find the cross product. [A, b, c] x [d, e, f] = [b * f - c * e, c * d - a * f, a * eb * d ]

Follow these three guidelines:

  • ( x axis) x ( y Axis) = ( z axis)
  • ( y axis) x ( z axis) = ( x
  • ( z axis) x ( x axis) = ( y

Given: An axis in an arbitrary base 3D coordinate system

Not enough information to do the search This unique solution is the reason for this problem, If you look at the second case (an axis in the arbitrary-base 2D coordination system), then you must first find an orthogonal vector. However, in the 3D space, an axis has an infinite amount of potential orthogonal vectors!

You can find one of the possible solutions.

A method of finding one [a, b, c] = root axis [d, e, f ] = Arbitrary orthogonal axis (can not be [0,0,0]) * * * * * B + E + C * F = 0

example For RAN, if your original axis is [2,3,4] , you will solve:

  2 * d + 3 * e + 4 * f = 0  

It satisfies the value of [d, e, f] that it is a satisfactory orthogonal vector (when Until it is not [0, 0,0] ). For example, [3, -2.0] :

  2 * 3 + 3 * -2 + 4 * 0 = 6 6 + - choose one As you can see, a "formula" that works  [d, e, f] = [b, -a, 0]  ... but there are many other people who can work too; Actually, there are infinite! 

Once you find your two axes [a, b, c] and [d, e, f], then >, you Let's back it up using your X and Y axis (or whatever) by using the [a, b, c] and [d, e, f] in the previous case (case 3) Axis you need them to your specific problem).


Generalization

Note that as you constantly do dot products and cross products, your vectors will start to grow bigger and larger than you want Based on that, it can not be desired, for example, you want your base vectors (your coordinating axes) all the same size / length.

To trigger any vector (except [0,0,0]) ) A unit vector (the same direction as the original vector In a vector with a length of 1):

  r = [a, b, c] v = sqrt (a ^ 2 + b ^ 2 + c ^ 2) & lt; - This is the length of the original vector r '= [a / v, b / v, c / v]    r   r  One example is a vector with a length of which  r  in its direction. Example: 

  r = [1,2,3] v = Sqrt (1 ^ 2 + 2 ^ 2 + 3 ^ 2) = sqm (13) = 3.60555 & lt; - This is the length of the original vector r '= [0.27735, 0.55470, 0.83205]  

Now, if I want to, for example, for the length of r 5 Along with, I only multiply r '* 5 , which is [a' * 5, b '* 5, c * * 5] .


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -