mirror of
https://github.com/Team4388/auto_planner.git
synced 2026-06-09 00:38:06 -06:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct {
|
||||
double x, y;
|
||||
} point;
|
||||
|
||||
typedef struct {
|
||||
double x, y, w, h;
|
||||
} rect;
|
||||
|
||||
#define FIELD_RESCALED field->w_meters, field->h_meters, 0, 0
|
||||
|
||||
// Rescales field coordinates to pixels
|
||||
point scale_to_screen(
|
||||
double x,
|
||||
double y,
|
||||
double w_meters,
|
||||
double h_meters,
|
||||
double x_off,
|
||||
double y_off);
|
||||
|
||||
// Rescales pixel coordinates to meters
|
||||
point scale_to_field(
|
||||
double x,
|
||||
double y,
|
||||
double w_meters,
|
||||
double h_meters,
|
||||
double x_off,
|
||||
double y_off);
|
||||
|
||||
bool within_box(point p, rect r);
|
||||
point lerp_point(point a, point b, float p);
|
||||
double get_distance(point a, point b);
|
||||
Reference in New Issue
Block a user