Paste #125686: Diff Report Between Paste #125685 and #125684

Date: 2024/08/17 20:32:01 UTC-07:00
Type: Diff Report

View Raw Paste Download This Paste Edit Of Paste 125685
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


 path_position_by_time:
     type: procedure
     definitions: PointA[LocationTag - Start of straight line path.]|PointB[LocationTag - End of straight line path.]|Time[ElementTag - How long, in seconds, it takes to go from Point A to Point B.]|Pos[ElementTag - When, in seconds, in the straight line, the location is.]
     description: Assuming a linear, uniform and straight line, with zero acceleration and constant speed, returns a LocationTag of where a point would be had it passed the given time travelling in the given line.
     debug: false
     script:
     - define vector <[PointB].sub[<[PointA]>]>
     - define length <[vector].vector_length>
     # Cross multiplication
     # If it takes Time to reach Length, then it takes x to reach Pos.
     - define PosTime <[Time].mul[<[Pos]>].div[<[Length]>]>
     # How many % of Time is PosTime?
     # Proportion
     - define x <[PosTime].div[<[Time]>]>
     # Apply proportion as vector length. A vector half the original will end at the middle of the original. A 1/3 vector will end at 1/3 of the path.
-    - determine <[vector].mul[<[x]>]>
+    - define PosVector <[vector].mul[<[x]>]>
+    # Adds the vector to the Point A.
+    - determine <[PointA].add[<[vector]>]>