Derek McQuay
4ad50ba37c
I am going to use the area of triangles when determining if the point is inside of another square to determine containment. This was just an important step
8 lines
171 B
Go
8 lines
171 B
Go
package rect
|
|
|
|
import "math"
|
|
|
|
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)
|
|
}
|