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
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/* Point in 2D space */
29 int32_t x;
30 int32_t y;
31};
32
33/* Finite line in 2D space */
38
50 struct cartesian_point_2d *intersection);
51
63 uint32_t radius);
64
76 const struct cartesian_point_2d *polygon, size_t vertices);
77
88 const struct cartesian_point_2d *polygon,
89 size_t vertices);
90
95#ifdef __cplusplus
96}
97#endif
98
99#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.
Definition cartesian.h:34
struct cartesian_point_2d a
Definition cartesian.h:35
struct cartesian_point_2d b
Definition cartesian.h:36
Definition cartesian.h:28
int32_t y
Definition cartesian.h:30
int32_t x
Definition cartesian.h:29