Difference between revisions of "Talk:Sqrt - Math"

1 byte added ,  10:06, 13 July 2023
m
(Created page with "== Calculating distance (example) == Calculating distance travelled with Pythagorean theorem, uses sqrt and pow: <source lang="papyrus"> Event OnEffectStart(Ac...")
 
Line 22: Line 22:


float dist = Math.sqrt(Math.pow((coords[3] - coords[0]), 2) + Math.pow((coords[4] - coords[1]), 2) + Math.pow((coords[5] - coords[2]), 2))
float dist = Math.sqrt(Math.pow((coords[3] - coords[0]), 2) + Math.pow((coords[4] - coords[1]), 2) + Math.pow((coords[5] - coords[2]), 2))
Debug.trace("Travelled " + dist + "units.")
Debug.trace("Travelled " + dist + " units.")
EndEvent
EndEvent
</source>
</source>
67

edits