changed permission on func and added maximum error
made sure that not all functions were public and changed some to private that need not be exposed. also added in maximum error to deal with floating point inaccuracies
This commit is contained in:
+1
-1
@@ -2,6 +2,6 @@ package rect
|
||||
|
||||
import "math"
|
||||
|
||||
func SizeTriangle(p1, p2, p3 Point) float64 {
|
||||
func sizeTriangle(p1, p2, p3 Point) float64 {
|
||||
return math.Abs((p1.X*p2.Y + p2.X*p3.Y + p3.X*p1.Y - p1.Y*p2.X - p2.Y*p3.X - p3.Y*p1.X) / 2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user