Oolite
Loading...
Searching...
No Matches
OOPointMaths.h File Reference
import "OOFunctionAttributes.h"
#include <tgmath.h>
Include dependency graph for OOPointMaths.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

OOINLINE NSPoint PtAdd (NSPoint a, NSPoint b)
OOINLINE NSPoint PtSub (NSPoint a, NSPoint b)
OOINLINE NSPoint PtScale (NSPoint p, CGFloat scale)
OOINLINE CGFloat PtDot (NSPoint a, NSPoint b)
OOINLINE CGFloat PtCross (NSPoint a, NSPoint b)
OOINLINE NSPoint PtRotCW (NSPoint p)
OOINLINE NSPoint PtRotACW (NSPoint p)
OOINLINE NSPoint PtNormal (NSPoint p)

Function Documentation

◆ PtAdd()

OOINLINE NSPoint PtAdd ( NSPoint a,
NSPoint b )

Definition at line 5 of file OOPointMaths.h.

6{
7 return NSMakePoint(a.x + b.x, a.y + b.y);
8}

References OOINLINE.

Referenced by BuildOutlineContour().

Here is the caller graph for this function:

◆ PtCross()

OOINLINE CGFloat PtCross ( NSPoint a,
NSPoint b )

Definition at line 25 of file OOPointMaths.h.

26{
27 return a.x * b.y - b.x * a.y;
28}

References OOINLINE.

Referenced by BuildOutlineContour().

Here is the caller graph for this function:

◆ PtDot()

OOINLINE CGFloat PtDot ( NSPoint a,
NSPoint b )

Definition at line 20 of file OOPointMaths.h.

21{
22 return a.x * b.x + a.y * b.y;
23}

References OOINLINE.

Referenced by BuildOutlineContour(), and PtNormal().

Here is the caller graph for this function:

◆ PtNormal()

OOINLINE NSPoint PtNormal ( NSPoint p)

Definition at line 42 of file OOPointMaths.h.

43{
44 return PtScale(p, 1.0 / sqrt(PtDot(p, p)));
45}
OOINLINE CGFloat PtDot(NSPoint a, NSPoint b)
OOINLINE NSPoint PtScale(NSPoint p, CGFloat scale)

References OOINLINE, PtDot(), and PtScale().

Referenced by BuildOutlineContour().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PtRotACW()

OOINLINE NSPoint PtRotACW ( NSPoint p)

Definition at line 36 of file OOPointMaths.h.

37{
38 // Rotate 90 degrees anticlockwise.
39 return NSMakePoint(-p.y, p.x);
40}

References OOINLINE.

Referenced by BuildOutlineContour().

Here is the caller graph for this function:

◆ PtRotCW()

OOINLINE NSPoint PtRotCW ( NSPoint p)

Definition at line 30 of file OOPointMaths.h.

31{
32 // Rotate 90 degrees clockwise.
33 return NSMakePoint(p.y, -p.x);
34}

References OOINLINE.

◆ PtScale()

OOINLINE NSPoint PtScale ( NSPoint p,
CGFloat scale )

Definition at line 15 of file OOPointMaths.h.

16{
17 return NSMakePoint(p.x * scale, p.y * scale);
18}

References OOINLINE.

Referenced by BuildOutlineContour(), and PtNormal().

Here is the caller graph for this function:

◆ PtSub()

OOINLINE NSPoint PtSub ( NSPoint a,
NSPoint b )

Definition at line 10 of file OOPointMaths.h.

11{
12 return NSMakePoint(a.x - b.x, a.y - b.y);
13}

References OOINLINE.

Referenced by BuildOutlineContour().

Here is the caller graph for this function: