Commit Graph

21 Commits

Author SHA1 Message Date
634cd011c0 ran gofmt -s
simplify things after having run gofmt -s
2016-08-29 10:27:36 -07:00
0f44030e53 updated the readme and cmd/recty/main.go
added examples to the readme and updated main.go to give an example of
who one could use the rect package
2016-08-27 22:28:15 -07:00
71f3aede25 updated IsRect to be public
this will allow users to make sure that the rectangles they define
really are rectangles
2016-08-27 22:27:51 -07:00
a35e73ee10 added doc.go 2016-08-27 21:51:34 -07:00
f88623a1e0 adding corrections for spelling and golint 2016-08-27 21:32:18 -07:00
ecc870943e added documentation for all functions 2016-08-27 21:14:16 -07:00
9b908a8db1 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
2016-08-27 20:46:32 -07:00
3850bdc592 created line.go and moved tests and funcs 2016-08-27 20:46:10 -07:00
ace4f45155 fixed typos and types in all tests 2016-08-27 19:08:51 -07:00
ff52a9115c added tests for rectangle intersection 2016-08-27 19:05:10 -07:00
d1b383fb45 intersection now works
returns []Point of intersection point(s)
2016-08-27 18:55:51 -07:00
3d8e58a61c added function to get intersection of two lines 2016-08-27 18:55:26 -07:00
aaf2dbb2eb implemented adjacency and tests
using the new line type am able to check if lines overlap or not.
2016-08-26 16:27:47 -07:00
d6e76ef26b functions to determine if point is on line
also includes lineOnLine to determine if a line is on another line.
Added a new type line struct which consists of two points.
2016-08-26 16:26:59 -07:00
69aff8a038 added function to test containment
Containment uses the sumOfTri to determine if a point is inside of the
rectangle, r1.  It checks all four points of r2 (p1, p2, p3, p4) against
r1.  If they are all inside, then the rectangle is contained.
2016-08-26 13:48:26 -07:00
4ad50ba37c added area of three points
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
2016-08-26 12:02:43 -07:00
fc4c1c820b determine size of rectangle
To determine the size of rectangle, it was required to be able to
determine who would be the neighboring points.  A neighbor is a point
that would make the exterior of the rectangle, not the cross-section.
Finding the neighbors allows for a simple l*w to calculate size.
2016-08-26 11:37:55 -07:00
b9bc23566f added method to determine distance between points
should be valuable to know what distance between two points is. Also
added testing
2016-08-26 11:37:18 -07:00
b5a9726d2d created rectangle struct and IsRect()
defined what a rectangle is and also implemented IsRect(), which returns
a bool whether the coordinates given make a rectangle or not.  Tests
were written for IsRect()
2016-08-26 09:08:30 -07:00
56f8910a4e updated gitignore for swp files 2016-08-26 09:07:42 -07:00
dm
f672f94faa initial commit 2016-08-26 08:13:01 -07:00