SHARE
TWEET

Untitled

a guest Jun 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CurPosX := float64(294397)
  2. CurPosY := float64(197421)
  3. NewPosX := float64(294277)
  4. NewPosY := float64(197670)
  5.  
  6. dx := NewPosX - CurPosX
  7. dy := NewPosY - CurPosY
  8.  
  9. distance := math.Sqrt(dx*dx+dy*dy)
  10.  
  11. offsetX := dx / distance
  12. OffsetY := dy / distance
  13.  
  14. bx := CurPosX
  15. bz := CurPosZ
  16.  
  17. for i := 0; i < int(distance)+3; i++ {
  18.     bx += offsetX
  19.     bz += OffsetZ
  20.     fmt.Printf("%f X %fn", bx, by)
  21. }
  22.      
  23. CurPosX := float64(294397)
  24. CurPosY := float64(197421)
  25. NewPosX := float64(294277)
  26. NewPosY := float64(197670)
  27.  
  28. dx := NewPosX - CurPosX
  29. dy := NewPosY - CurPosY
  30.  
  31. distance := math.Sqrt(dx*dx + dy*dy)
  32.  
  33. bx := CurPosX
  34. by := CurPosY
  35.  
  36. n = int(distance)
  37.  
  38. for i := 0; i <= n; i++ {
  39.     bx = CurPosX + dx * i / n
  40.     by = CurPosY + dy * i / n
  41.     fmt.Printf("%f X %fn", bx, by)
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top