Commit Graph

4 Commits

Author SHA1 Message Date
Nigel Tao
d9c0088098 math/fixed: add I and P helper functions.
The P function is especially common in e.g. Freetype code that works
with both the integer-pixel (X,Y) coordinates used by the stdlib image
package and sub-pixel (X,Y) coordinates used by its raster package.

Change-Id: I68be8ca71ceb24f40277ecc39a0896323f6671f5
Reviewed-on: https://go-review.googlesource.com/13652
Reviewed-by: Rob Pike <r@golang.org>
2015-08-17 07:17:06 +00:00
Nigel Tao
b96af5338f math/fixed: add Point methods (Add, Sub, Mul, Div).
These mirror the image.Point methods in the standard library.

Change-Id: I7309af308a8182e325af20b47341f72703cbc95a
Reviewed-on: https://go-review.googlesource.com/13603
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-13 13:30:46 +00:00
Nigel Tao
3029cff51e math/fixed: add point types.
Change-Id: Ie9ae62eab3c484034ee8207a2b2e573ec6f1464e
Reviewed-on: https://go-review.googlesource.com/13294
Reviewed-by: Rob Pike <r@golang.org>
2015-08-07 00:23:53 +00:00
Nigel Tao
5ec5e003b2 math/fixed: new package.
Fixes golang/go#11906

Change-Id: I2b43311ff145e8453cd255f085c82add6da7de5b
Reviewed-on: https://go-review.googlesource.com/12863
Reviewed-by: Rob Pike <r@golang.org>
2015-07-30 06:07:28 +00:00