golang / geo

S2 geometry library in Go
Apache License 2.0
1.69k stars 182 forks source link

Strange results #5

Closed djadala closed 8 years ago

djadala commented 8 years ago

Hi,

just realized that LatLngFromDegrees does not convert argumens:

package main
import (
    "fmt"
    "github.com/golang/geo/s2"
    "github.com/golang/geo/s1"
)

func main() {
    fmt.Println(  s1.Degree, float64(s1.Degree), s2.LatLngFromDegrees(1, 1))  
}

result:

1.0000000 0.017453292519943295 [1.0000000, 1.0000000]

go version
go version go1.6 linux/amd64

go compiled from source

rsned commented 8 years ago

LatLng prints out the Lat and Lng as s1.Angles, and s1.Angle's String method formats the numbers as degrees, so that's why you are seeing the last value as [1.00000, 1.00000]

On Thu, Mar 17, 2016 at 1:36 PM, Jamil Djadala notifications@github.com wrote:

Hi,

just realized that LatLngFromDegrees does not convert argumens:

package mainimport ( "fmt" "github.com/golang/geo/s2" "github.com/golang/geo/s1" ) func main() { fmt.Println( s1.Degree, float64(s1.Degree), s2.LatLngFromDegrees(1, 1)) }

result:

1.0000000 0.017453292519943295 [1.0000000, 1.0000000]

go version go version go1.6 linux/amd64

go compiled from source

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/golang/geo/issues/5

djadala commented 8 years ago

Ah, sorry for noise, got it Thanks.