LLIEPLLIEHb Posted April 5, 2022 Share Posted April 5, 2022 local points = {{0,0},{1,7},{7,7},{15,7},{30,30},{7,14},{14,14},{25,25},{25,18},{20,18},{10,25}} local p1x,p1y = points[1][1],points[1][2] local p2x,p2y = points[5][1],points[5][2] local orig = getDistanceBetweenPoints2D ( p1x,p1y,p2x,p2y ) local analog = math.sqrt((p2x - p1x) * (p2x - p1x) + (p2y - p1y) * (p2y - p1y)) iprint("original-", orig) iprint("analog-", analog) Debug Script 3 Link to comment
Incama Posted April 5, 2022 Share Posted April 5, 2022 Does it always return the same numbers after multiple runs? IMHO you're seeing float point math's inaccuracy here. Link to comment
LLIEPLLIEHb Posted April 5, 2022 Author Share Posted April 5, 2022 Returns a static value after restarting Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now