Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- type Point struct {
- x float64
- y float64
- }
- func main() {
- p := Point{x: 3.0, y: 4.0}
- q := Point{x: 0.0, y: 0.0}
- distance := math.Sqrt(math.Pow(p.x-q.x, 2) + math.Pow(p.y-q.y, 2))
- fmt.Println(distance)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement