Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Cartesian math APIs

Cartesian math API . More...

Data Structures

struct  cartesian_point_2d
 
struct  cartesian_line_2d
 

Functions

bool cartesian_line_intersection (struct cartesian_line_2d a, struct cartesian_line_2d b, struct cartesian_point_2d *intersection)
 Find the intersection point of two finite lines, if it exists.
 
bool cartesian_point_in_circle (struct cartesian_point_2d point, struct cartesian_point_2d origin, uint32_t radius)
 Determine if a point in inside a circle.
 
bool cartesian_point_in_polygon (struct cartesian_point_2d point, const struct cartesian_point_2d *polygon, size_t vertices)
 Determine if a point in inside an arbitrary polygon.
 
uint32_t cartesian_distance_to_polygon_edge (struct cartesian_point_2d point, const struct cartesian_point_2d *polygon, size_t vertices)
 Determine the minimum distance to a polygons edge.
 

Detailed Description

Cartesian math API .

Function Documentation

◆ cartesian_distance_to_polygon_edge()

uint32_t cartesian_distance_to_polygon_edge ( struct cartesian_point_2d point,
const struct cartesian_point_2d * polygon,
size_t vertices )

#include <infuse/math/cartesian.h>

Determine the minimum distance to a polygons edge.

Parameters
pointPoint to test
polygonPointer to array of points defining the polygon (Do not duplicate first point)
verticesNumber of points in polygon array
Returns
uint32_t Distance to the nearest edge

◆ cartesian_line_intersection()

bool cartesian_line_intersection ( struct cartesian_line_2d a,
struct cartesian_line_2d b,
struct cartesian_point_2d * intersection )

#include <infuse/math/cartesian.h>

Find the intersection point of two finite lines, if it exists.

Parameters
aFirst finite line
bSecond finite line
intersectionStorage for intersection point
Returns
true If finite lines intersect
false If finite lines do not intersect, or are collinear

◆ cartesian_point_in_circle()

bool cartesian_point_in_circle ( struct cartesian_point_2d point,
struct cartesian_point_2d origin,
uint32_t radius )

#include <infuse/math/cartesian.h>

Determine if a point in inside a circle.

Parameters
pointPoint to test
originCentre point of circle
radiusRadius of circle
Returns
true If point is inside circle
false If point is outside of circle

◆ cartesian_point_in_polygon()

bool cartesian_point_in_polygon ( struct cartesian_point_2d point,
const struct cartesian_point_2d * polygon,
size_t vertices )

#include <infuse/math/cartesian.h>

Determine if a point in inside an arbitrary polygon.

Parameters
pointPoint to test
polygonPointer to array of points defining the polygon (Do not duplicate first point)
verticesNumber of points in polygon array
Returns
true If point is inside polygon
false If point is outside of polygon