Vector projection to other vector

In summary, the conversation is about projecting one vector onto another in a 3D space using a specified direction. The person is working in Unity and needs to create their own projection function. They are also discussing the mathematical concept of vector dot product as a method for achieving this projection.
  • #1
twoski
181
2
Let's say i have 2 arbitrary vectors in a 3d space. I want to project Vector A to Vector B using a specified normal.

edit: better image

PQh2BdO.png


A is green, B is red, C is red arrow. Blue is result.

In this case, i want to project green vector to red vector in the red direction. This would give me the blue vector as a result.

I'm working in unity and they have a projection function, but it doesn't operate how i want it to... So i guess i need to make my own.

Here is the projection function they do have: https://docs.unity3d.com/ScriptReference/Vector3.Project.html
 

Attachments

  • nlUJHEW.png
    nlUJHEW.png
    5.9 KB · Views: 341
  • PQh2BdO.png
    PQh2BdO.png
    1.5 KB · Views: 681
Last edited:
  • Like
Likes Delta2
Technology news on Phys.org
  • #2
The drawing is really bad. Can you try to explain what are you trying to do mathematically ?

As I understand you have three vectors, ##\vec {A},\vec {B},\vec {C}## you want to project ##\vec {A}## on ##\vec {B}##. on direction ##\vec {C}## ?

Isnt it the same as A projection on C ? Since A projection on B gives you a vector on B direction and then you want to project it again on C ?

If this is true I can help you with the code part. I guess at least for the math part.
 
  • #3
Sorry that's not a great picture. A and B are 2 vectors in a 3d Space. I want to project Vector B to Vector A in a given direction, ie. Normalized Vector C.
 
  • #4
I guess I ll not be able to help ..sorry
 
  • #5

What is vector projection?

Vector projection is the process of finding a vector that is parallel to a given vector, and has a specified length. It is used to decompose a vector into two components, one that is parallel to another vector and one that is perpendicular to it.

How is vector projection calculated?

The formula for calculating the vector projection of vector A onto vector B is A • (B/|B|), where • represents the dot product and |B| represents the magnitude of vector B. This formula gives the length of the projection vector that is parallel to vector B.

What is the significance of vector projection?

Vector projection is useful in many areas of science and engineering, including physics, mathematics, and computer graphics. It allows us to analyze and manipulate vectors in a more simplified manner, making calculations and visualizations easier to understand.

Can vector projection be negative?

Yes, vector projection can be negative. This occurs when the angle between the two vectors is greater than 90 degrees. In this case, the projection vector will point in the opposite direction of the original vector.

How is vector projection used in real-world applications?

Vector projection has many practical applications, such as in motion analysis, 3D modeling, and navigation systems. It is also used in physics to analyze forces acting on objects and in mathematics to solve problems involving vectors and their components.

Similar threads

  • Programming and Computer Science
2
Replies
53
Views
3K
  • Linear and Abstract Algebra
Replies
9
Views
379
  • Special and General Relativity
5
Replies
146
Views
6K
  • Programming and Computer Science
2
Replies
66
Views
4K
  • Programming and Computer Science
Replies
19
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Differential Equations
Replies
7
Views
137
Replies
9
Views
1K
Replies
13
Views
2K
Replies
2
Views
1K
Back
Top