Can the Dot Product be Customized to Change Linearly?

In summary, The dot product between two unit vectors is ##\cos(\theta)##. To change it linearly, you can compute ##\cos^{-1}(u \cdot v)## if ##u## and ##v## are unit vectors or ##\cos^{-1}((u/\|u\|) \cdot (v / \|v\|))## in general. The result will be an angle between ##-\pi/2## and ##\pi/2##, which can be scaled as desired. However, this would no longer be the dot product. The original purpose for wanting to do this was to make a game, but it is not a correct interpretation of the dot product. It would be better
  • #1
aosome23
16
0
So, is there anyway to make the dot product change linearly? What I mean by this is when the angle is 45 degrees, I want it to be 0.5 instead of 0.7071 as you can see in this image:

CosineValues.png


Instead I want 45 degrees to be 0.5, 60 degrees to be 0.33 and 30 degrees to be 0.66. Same would apply for the other side(135 should be -0.5)

Thank you
 
Physics news on Phys.org
  • #2
You can redefine it to be anything you like but it wouldn't be the dot product anymore. What is your purpose in wanting to do such a thing?
 
  • #3
The dot product between two unit vectors is ##\cos(\theta)##. It seems that you just want ##\theta##. So you can compute ##\cos^{-1}(u \cdot v)## if ##u## and ##v## are unit vectors, or ##\cos^{-1}((u/\|u\|) \cdot (v / \|v\|))## in general. The result will be an angle between ##-\pi/2## and ##\pi/2##, which you can then scale as you like. If you want the range to be from ##-1## to ##1##, then multiply by ##2/\pi##.
 
  • Like
Likes 1 person
  • #4
HallsofIvy said:
You can redefine it to be anything you like but it wouldn't be the dot product anymore. What is your purpose in wanting to do such a thing?

I'm trying to make a game and for some reason I thought that the dot product changed consistently with the angle.
 
  • #5
jbunniii said:
The dot product between two unit vectors is ##\cos(\theta)##. It seems that you just want ##\theta##. So you can compute ##\cos^{-1}(u \cdot v)## if ##u## and ##v## are unit vectors, or ##\cos^{-1}((u/\|u\|) \cdot (v / \|v\|))## in general. The result will be an angle between ##-\pi/2## and ##\pi/2##, which you can then scale as you like. If you want the range to be from ##-1## to ##1##, then multiply by ##2/\pi##.

Thank You! I did not know that the dot product is cos!
:D
 
  • #6
aosome23 said:
Thank You! I did not know that the dot product is cos!
:D

This is an incorrect way to interpret what was said, you missed the unit vector qualifier that would make A dot B = cos(theta) true. Generally the dot product is defined as A dot B = ||A|| ||B||cos(theta). I think if you just defined a switch statement or better yet, a class, to do what you want you could avoid the whole reinventing the dot product here.
 
Last edited:

1. What is a dot product and why is it important in science?

The dot product is a mathematical operation that takes two vectors and produces a scalar quantity. It is important in science because it allows us to measure the similarity or perpendicularity of two vectors, which is useful in various fields such as physics, engineering, and computer science.

2. What are some common problems that can arise with dot products?

One common problem with dot products is when the two vectors are not in the same dimension, making it impossible to calculate the dot product. Another problem is when one or both vectors have a magnitude of zero, resulting in a dot product of zero.

3. How do you calculate the dot product of two vectors?

To calculate the dot product of two vectors, you multiply the corresponding components of each vector and then add all the products together. For example, if vector A is (2, 4, 6) and vector B is (3, 1, 5), the dot product would be (2 * 3) + (4 * 1) + (6 * 5) = 6 + 4 + 30 = 40.

4. Can the dot product be negative?

Yes, the dot product can be negative. This occurs when the angle between the two vectors is greater than 90 degrees, indicating that they are pointing in opposite directions.

5. In what real-life applications is the dot product used?

The dot product has many real-life applications, such as in physics to calculate work and energy, in computer graphics to determine the angle between two surfaces, and in economics to measure the correlation between two variables.

Similar threads

  • Calculus
Replies
8
Views
2K
  • Linear and Abstract Algebra
Replies
16
Views
2K
Replies
14
Views
1K
  • Quantum Physics
Replies
8
Views
2K
  • STEM Academic Advising
Replies
16
Views
494
  • Linear and Abstract Algebra
Replies
4
Views
868
  • Advanced Physics Homework Help
Replies
1
Views
974
  • Calculus and Beyond Homework Help
Replies
3
Views
3K
Replies
8
Views
834
Replies
10
Views
4K
Back
Top