User Tools

Site Tools


prpl:distance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
prpl:distance [2016/12/02 23:33] – external edit 127.0.0.1prpl:distance [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 4: Line 4:
  
 ^Arguments^Result^Notation^ ^Arguments^Result^Notation^
-| | | [ - ] |+Coordinates1, Coordinates2Distance between Coordinates| [ x1, y1, x2, y2 f1 ] |
  
  
 === Description === === Description ===
 +Returns the distance between two given pairs of coordinates. (Or two sets of number pairs on the coordinate plane)
  
 === Examples === === Examples ===
-<code> float y1 = GetFloatFromStack();  +<code> 
- float x1 = GetFloatFromStack();  +CurrentCoords 0 0 Distance ->Distance //Find the distance between itself and 0,0 
- float y2 = GetFloatFromStack();  +<-Distance Trace
- float x2 = GetFloatFromStack();  +
- float di = Mathf.Sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));  +
- stack.Push(new Data(di));  +
-  +
-</code>+
  
 +Self GetUnitPixelCoords <-SomeUnit GetUnitPixelCoords Distance Trace #This kind of think is useful for image scaling.
 +</code>
prpl/distance.1480721636.txt.gz · Last modified: 2025/02/14 14:56 (external edit)