Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
cartesian.h
Go to the documentation of this file.
1
9
10#ifndef INFUSE_SDK_INCLUDE_INFUSE_MATH_CARTESIAN_H_
11#define INFUSE_SDK_INCLUDE_INFUSE_MATH_CARTESIAN_H_
12
13#include <stdint.h>
14#include <stdbool.h>
15#include <stdlib.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
27
31 int32_t x;
33 int32_t y;
34};
35
43
55 struct cartesian_point_2d *intersection);
56
68 uint32_t radius);
69
81 const struct cartesian_point_2d *polygon, size_t vertices);
82
93 const struct cartesian_point_2d *polygon,
94 size_t vertices);
95
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif /* INFUSE_SDK_INCLUDE_INFUSE_MATH_CARTESIAN_H_ */
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.
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.
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.
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.
Finite line in 2D space.
Definition cartesian.h:37
struct cartesian_point_2d a
First end point of the line.
Definition cartesian.h:39
struct cartesian_point_2d b
Second end point of the line.
Definition cartesian.h:41
Point in 2D space.
Definition cartesian.h:29
int32_t y
Y coordinate.
Definition cartesian.h:33
int32_t x
X coordinate.
Definition cartesian.h:31