This is algebra.c in view mode; [Download] [Up]
/********************************************************** * 1994, Martin Wennerberg **********************************************************/ #include "algebra.h" NSPoint PT_sum (NSPoint p1, NSPoint p2) { p1.x += p2.x; p1.y += p2.y; return p1; } NSPoint PT_sub (NSPoint p1, NSPoint p2) { p1.x -= p2.x; p1.y -= p2.y; return p1; } NSPoint PT_scale (float k, NSPoint p) { p.x *= k; p.y *= k; return p; } /* returns a vector perpendicular to and the same length as p */ NSPoint PT_perp (NSPoint p) { NSPoint res; res.x = p.y; res.y = -p.x; return res; }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.