Ben Cragg
ecda96a36f
removed unneeded Min call
2019-02-14 14:23:50 +00:00
Ben Cragg
e225e9a1ef
corrected comment
2019-02-14 14:23:50 +00:00
Ben Cragg
13171c409b
using Lerp
2019-02-14 14:23:50 +00:00
Ben Cragg
23168ee324
remove local var
2019-02-14 14:23:50 +00:00
Ben Cragg
44d030b9ca
normalising before getting bigger/smaller
2019-02-14 14:23:50 +00:00
Ben Cragg
b06a31baa3
Removed Diameter function
2019-02-14 14:23:50 +00:00
Ben Cragg
4c6d061455
added rect-circle intersection functions
2019-02-14 14:23:50 +00:00
Ben Cragg
16722d55e1
not exporting circle size comparisons
2019-02-14 14:22:52 +00:00
Ben Cragg
ee24eeb67d
fixed circle.Intersect
2019-02-14 14:22:52 +00:00
Ben Cragg
5072f34b91
Added Circle geometry and tests
2019-02-14 14:22:52 +00:00
Jacek Olszak
2e0da4f44a
#159 Another reduction of Simplify Matrix.Unproject formulas
2019-02-12 21:06:37 +01:00
Jacek Olszak
b0ed22e0ec
#159 Simplify Matrix.Unproject formulas
2019-02-12 21:00:05 +01:00
Jacek Olszak
1e19db5b25
#159 Add test case when matrix determinant is not 1
2019-02-12 18:40:15 +01:00
Jacek Olszak
cabaee680e
#159 Fix unproject for rotated matrix
2019-02-12 14:57:03 +01:00
Stephen Michaelis
8d20deea05
update MouseEntered to MouseInsideWindow
2019-01-21 17:13:51 -05:00
Stephen Michaelis
e7a625f5d2
updated Floor method
2019-01-20 10:00:35 -05:00
Stephen Michaelis
d3f6331240
Adding a pixel.Vec Floor method to geometry.go
2019-01-20 09:56:30 -05:00
NaniteFactory
abfdf18fb6
fix typo for matrix
2018-09-05 12:53:25 +09:00
faiface
721a10ef10
add Vec.Project
2017-10-15 19:50:41 +02:00
faiface
c87741300d
add pixel.Unit
2017-10-15 19:43:12 +02:00
faiface
62cefc262e
add pixel.Clamp
2017-10-15 19:42:13 +02:00
faiface
ce09bb1114
fix Matrix.Chained (wrong order of composition)
2017-09-04 00:40:12 +02:00
faiface
7c5e5588e2
fix Vec.Normal to rotate by pi/2, not -pi/2
2017-08-29 20:23:32 +02:00
Alex
3e3a9aaa48
fix operation order for rectangle resize function, add tests
2017-07-29 00:40:06 +12:00
faiface
e64d97efb1
fix Rect.Intersect
2017-07-05 20:36:25 +02:00
faiface
da52aa25ec
clarify Rect.Intersect doc
2017-07-05 19:58:09 +02:00
faiface
69d4a37e5e
add Rect.Intersect
2017-07-05 19:54:30 +02:00
faiface
2b9b4d07c4
add Rect.Area
2017-07-05 19:54:18 +02:00
faiface
886e7fa22a
another minor code style change
2017-06-11 14:14:02 +02:00
faiface
99a43ec1a9
minor code style change
2017-06-11 14:06:45 +02:00
faiface
d4cd1c33e2
one more tiny doc change
2017-06-11 01:18:23 +02:00
faiface
51cd0314d5
minor doc changes
2017-06-11 01:17:37 +02:00
Seebs
daedc45ea9
Improve normal calculations
...
Soooo. It turns out that the bunch of smallish (~4-5% of runtime)
loads associated with Len(), Unit(), Rotated(), and so on... Were
actually more like 15% or more of computational effort. I first
figured this out by creating:
func (u Vec) Normal(v Vec) Vec
which gives you a vector normal to u->v. That consumed a lot
of CPU time, and was followed by .Unit().Scaled(imd.thickness / 2),
which consumed a bit more CPU time.
After some poking, and in the interests of avoiding UI cruft,
the final selection is
func (u Vec) Normal() Vec
This returns the vector rotated 90 degrees, which turns out to
be the most common problem.
2017-06-10 17:55:16 -05:00
faiface
c0766504e3
minor, mostly stylistic, changes
2017-06-09 18:13:05 +02:00
Seebs
c321515d3c
Simplify Matrix math, use 6-value affine matrixes.
...
It turns out that affine matrices are much simpler than the 3x3 matrices
they imply, and we can use this to dramatically streamline some code.
For a test program, this was about a 50% gain in frame rate just from
the cost of the applyMatrixAndMask calls in imdraw, which were calling
matrix.Project() many times. Simplifying matrix.Project, alone, got a
nearly 50% frame rate boost!
Also modify pixelgl's SetMatrix to copy the six values of a 3x2
Affine into the corresponding locations of a 3x3 matrix.
2017-06-09 10:37:43 -05:00
faiface
b8a287a654
clarify Rect doc
2017-05-21 19:38:21 +02:00
faiface
523e6d3e9a
fix Matrix doc
2017-05-21 19:30:29 +02:00
faiface
fcfeb200b6
replace complex128 Vec with a struct
2017-05-21 19:25:06 +02:00
faiface
fdddde2780
accept zero target size in Rect.Resized
2017-05-15 01:15:16 +02:00
faiface
1619373062
add Rect.Union
2017-05-05 15:43:24 +02:00
faiface
8030595373
simplify code in Rect.Resized
2017-04-13 15:26:48 +02:00
faiface
9472b91565
fix grammar in Vec doc
2017-04-13 15:18:13 +02:00
faiface
b41e117ac6
fix Matrix.String
2017-04-04 14:10:39 +02:00
faiface
49338251d2
add Matrix.String
2017-04-04 14:08:37 +02:00
faiface
b135012115
minor change
2017-04-04 14:02:39 +02:00
faiface
5d98f28ca0
remove auto norm from R (Rect constructor)
2017-03-25 19:45:11 +01:00
faiface
4bebc7e6e4
add Vec.WithX/WithY and Rect.WithMin/WithMax
2017-03-23 19:27:39 +01:00
faiface
4619398b9e
fix 0 vector len + fix imdraw polyline
2017-03-23 19:15:06 +01:00
faiface
bec6bdca6a
add Matrix.Chained
2017-03-19 00:08:46 +01:00
faiface
2e8f5fb05a
remove Vec.YX because it's unreadable
2017-03-18 11:55:01 +01:00