daugfernandes / gogeom

Automatically exported from code.google.com/p/gogeom
GNU General Public License v3.0
0 stars 0 forks source link

Polygon2D MBR crashes if 1 or 0 points #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If a Polygon2d has 1 or no points, MBR crashes

Original issue reported on code.google.com by azserrata on 21 Sep 2010 at 11:16

GoogleCodeExporter commented 9 years ago
package main
import (
    "fmt"
        "./geom"
)
func main() {
    p1 := &geom.Point2D{10,0}
    ps1 := &geom.Polygon2D{[]geom.Point2D{*p1}};
    fmt.Println(ps1.MBR())
    return
}

Original comment by azserrata on 21 Sep 2010 at 11:22

GoogleCodeExporter commented 9 years ago
Should return nil is such a case.

Original comment by azserrata on 21 Sep 2010 at 11:56