Can the Dot Product be Customized to Change Linearly?

Click For Summary

Discussion Overview

The discussion revolves around the possibility of customizing the dot product to yield linear outputs based on angles, specifically aiming for values like 0.5 at 45 degrees, 0.33 at 60 degrees, and 0.66 at 30 degrees. Participants explore the implications of redefining the dot product and its mathematical properties.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • One participant questions the feasibility of making the dot product change linearly, suggesting that such a redefinition would not retain the properties of the dot product.
  • Another participant explains that the dot product between two unit vectors is defined as ##\cos(\theta)## and proposes calculating the angle using the inverse cosine function, which can then be scaled.
  • A later reply emphasizes the importance of the unit vector condition for the relationship between the dot product and cosine to hold true, suggesting that a different approach, like a switch statement or class, might be more appropriate for the desired functionality.
  • There is a repeated acknowledgment of the relationship between the dot product and cosine, with one participant expressing surprise at this connection.

Areas of Agreement / Disagreement

Participants express differing views on the feasibility and implications of redefining the dot product. There is no consensus on how to achieve the desired linearity while maintaining the mathematical integrity of the dot product.

Contextual Notes

Participants highlight the necessity of unit vectors for the standard definition of the dot product and suggest that any redefinition may lead to a loss of its conventional properties.

aosome23
Messages
16
Reaction score
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
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?
 
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   Reactions: 1 person
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.
 
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
 
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:

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 10 ·
Replies
10
Views
1K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 10 ·
Replies
10
Views
5K
  • · Replies 13 ·
Replies
13
Views
3K