objc

Data Structures | Typedefs | Functions
NXPoint.h File Reference

2D point type and operations. More...

#include <stdbool.h>
#include <stdint.h>
Include dependency graph for NXPoint.h:

Go to the source code of this file.

Data Structures

struct  NXPoint
 A structure representing a point in 2D space. More...
 

Typedefs

typedef struct NXPoint NXPoint
 A structure representing a point in 2D space.
 

Functions

static bool NXEqualsPoint (NXPoint a, NXPoint b)
 Compare two points for equality. More...
 
static NXPoint NXMakePoint (int32_t x, int32_t y)
 Create an NXPoint from integer coordinates. More...
 

Detailed Description

2D point type and operations.

This header defines NXPoint, a structure representing a point in 2D space. It provides operations for creating, manipulating, and comparing points.

Definition in file NXPoint.h.

Function Documentation

◆ NXEqualsPoint()

static bool NXEqualsPoint ( NXPoint  a,
NXPoint  b 
)
inlinestatic

Compare two points for equality.

Returns true when both X and Y coordinates are equal.

Parameters
aFirst point to compare.
bSecond point to compare.
Returns
true if points are equal; false otherwise.

Definition at line 32 of file NXPoint.h.

32  {
33  return (a.x == b.x) && (a.y == b.y);
34 }
int32_t x
The X coordinate of the point.
Definition: NXPoint.h:19
int32_t y
The Y coordinate of the point.
Definition: NXPoint.h:20

◆ NXMakePoint()

static NXPoint NXMakePoint ( int32_t  x,
int32_t  y 
)
inlinestatic

Create an NXPoint from integer coordinates.

Convenience constructor for creating an NXPoint value. Implemented as a header-only static inline function so it can be used without an external symbol.

Parameters
xThe X coordinate.
yThe Y coordinate.
Returns
An NXPoint with the given coordinates.

Definition at line 47 of file NXPoint.h.

47  {
48  NXPoint p;
49  p.x = x;
50  p.y = y;
51  return p;
52 }
int32_t x
The X coordinate of the point.
Definition: NXPoint.h:19
int32_t y
The Y coordinate of the point.
Definition: NXPoint.h:20
A structure representing a point in 2D space.
Definition: NXPoint.h:18