Skip to content

Instantly share code, notes, and snippets.

@brydavis
Last active March 9, 2016 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brydavis/117a28db6053d53ad791 to your computer and use it in GitHub Desktop.
Save brydavis/117a28db6053d53ad791 to your computer and use it in GitHub Desktop.
package main
import "fmt"
import "math"
var pow = math.Pow
var sqrt = math.Sqrt
func main() {
x1, y1 := 0, 0
x2, y2 := 4, 5
a := float64(x2 - x1)
b := float64(y2 - y1)
c2 := pow(a, 2.0) + pow(b, 2.0)
fmt.Println(sqrt(c2))
}
package main
import "fmt"
import . "math"
func main() {
x1, y1 := 0, 0
x2, y2 := 4, 5
a := float64(x2 - x1)
b := float64(y2 - y1)
c2 := Pow(a, 2.0) + Pow(b, 2.0)
fmt.Println(Sqrt(c2))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment