Cleaned up notes; restructured test scene plus cpu controller script; added WIP action stack logic
This commit is contained in:
+7
-52
@@ -2,6 +2,12 @@
|
||||
|
||||
<img src="intuiting-pi.jpg" alt="Intuiting PI" width="400">
|
||||
|
||||
# Tools
|
||||
|
||||
-- https://www.desmos.com/calculator
|
||||
|
||||
# Thoughts
|
||||
|
||||
var target_position = jet.to_local(jet.target.global_position)
|
||||
-- Gets us the position of a target jet relative to the jet itself.
|
||||
-- This treats the jet as the center of the world when calculating.
|
||||
@@ -73,6 +79,7 @@ If queue do we push "rotate towards using xyz pattern" as a command/state to che
|
||||
|
||||
### Thoughts on using dot product to check the normalized target position from 'to_local':
|
||||
|
||||
- https://www.youtube.com/watch?v=2PrSUK1VrKA
|
||||
- https://www.youtube.com/watch?v=-udnENzlV4U
|
||||
|
||||
- From, Godot docu:
|
||||
@@ -118,55 +125,3 @@ Is there anything meaningfully gained from that?
|
||||
|
||||
|
||||
##### Dot Product Formula
|
||||
|
||||
- From, GPT:
|
||||
The formula is: A⋅B=∣A∣∣B∣cos(θ)
|
||||
|
||||
Where:
|
||||
|
||||
- `A` = Your target direction vector.
|
||||
- `B` = Your forward direction vector.
|
||||
- `θ` = Angle between the two vectors.
|
||||
- `|A|` and `|B|` = Magnitudes (lengths) of the vectors.
|
||||
|
||||
Since both vectors are normalized (length = 1), the formula simplifies to:
|
||||
|
||||
A⋅B=cos(θ)
|
||||
|
||||
You have:
|
||||
A=(0,0,1)
|
||||
B=(46,33,9)
|
||||
|
||||
1. Multiply corresponding components
|
||||
|
||||
The dot product formula is:
|
||||
A⋅B=(AxBx)+(AyBy)+(AzBz)
|
||||
|
||||
Substitute your values:
|
||||
=(0×46)+(0×33)+(1×9)
|
||||
=9
|
||||
|
||||
2. Normalize by vector lengths
|
||||
|
||||
Remember, the full formula also divides by the magnitudes when finding cosine:
|
||||
cos(θ)=A⋅B/(∣A∣∣B∣)
|
||||
|
||||
Calculate the lengths/magnitudes:
|
||||
∣A∣=sqrt(0^2+0^2+1^2)=1
|
||||
∣B∣=sqrt(46^2+33^2+9^2)
|
||||
∣B∣=sqrt(3266)≈57.15
|
||||
∣B∣=3266≈57.15
|
||||
|
||||
3. Calculate cosine
|
||||
cos(θ)=9/(1x57.15)
|
||||
cos(θ)≈0.1575
|
||||
|
||||
-- Note: 0.1575 is not radians or degrees.
|
||||
-- It's a dimensionless number representing the cosine of the angle.
|
||||
-- Think of it as an intermediate result.
|
||||
|
||||
4. Calculate the angle
|
||||
θ=cosec(0.1575) = ≈1.412 radians
|
||||
θ≈80.94degrees
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user