Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
plane_chart.h
Go to the documentation of this file.
1
9#ifndef OAKFIELD_PLANE_CHART_H
10#define OAKFIELD_PLANE_CHART_H
11
13
14#include <stdbool.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define SIM_PLANE_CHART_EPS 1.0e-12
21
31
40
50
63
64enum {
65 SIM_PLANE_CHART_SEMANTIC_NONE = 0u,
66 SIM_PLANE_CHART_SEMANTIC_PERIODIC_SECONDARY = 1u << 0,
67 SIM_PLANE_CHART_SEMANTIC_SINGULAR_CENTER = 1u << 1,
68 SIM_PLANE_CHART_SEMANTIC_SECONDARY_BRANCH_CUT = 1u << 2
69};
70
71enum { SIM_PLANE_CHART_CAPABILITY_NONE = 0u };
72
86
101
108
116
125
133
143
153
160
168
176
189 const SimPlaneChartConfig *chart, double x, double y,
190 double t, SimPlaneChartCoord *out_coord);
191
201 SimPlaneChartCoord coord,
202 SimPlaneProjectionValue *out_value);
203
217 const SimPlaneChartConfig *chart,
218 const SimPlaneProjectionConfig *projection,
219 double x, double y, double t,
220 SimPlaneProjectionValue *out_value);
221
236 SimPlaneSamplingFrame *out_frame,
237 SimPlaneChartConfig *out_chart,
238 SimPlaneProjectionConfig *out_projection);
239
240#ifdef __cplusplus
241}
242#endif
243
244#endif /* OAKFIELD_PLANE_CHART_H */
Shared spatial coordinate helpers for stimulus operators.
SimPlaneChartKind
Coordinate chart families available for 2D plane parameterization.
Definition plane_chart.h:25
@ SIM_PLANE_CHART_SPIRAL
Definition plane_chart.h:29
@ SIM_PLANE_CHART_ELLIPTIC
Definition plane_chart.h:28
@ SIM_PLANE_CHART_POLAR
Definition plane_chart.h:27
@ SIM_PLANE_CHART_CARTESIAN
Definition plane_chart.h:26
SimPlaneChartStatus
Status values returned by plane-chart helpers.
Definition plane_chart.h:54
@ SIM_PLANE_CHART_STATUS_NON_INVERTIBLE
Definition plane_chart.h:60
@ SIM_PLANE_CHART_STATUS_OUT_OF_DOMAIN
Definition plane_chart.h:58
@ SIM_PLANE_CHART_STATUS_SINGULAR
Definition plane_chart.h:59
@ SIM_PLANE_CHART_STATUS_NUMERIC_FAILURE
Definition plane_chart.h:61
@ SIM_PLANE_CHART_STATUS_OK
Definition plane_chart.h:55
@ SIM_PLANE_CHART_STATUS_INVALID_ARGUMENT
Definition plane_chart.h:56
@ SIM_PLANE_CHART_STATUS_UNSUPPORTED
Definition plane_chart.h:57
const char * sim_plane_chart_status_string(SimPlaneChartStatus status)
Human-readable description of a plane-chart status.
SimPlaneChartStatus sim_plane_projection_eval(const SimPlaneProjectionConfig *projection, SimPlaneChartCoord coord, SimPlaneProjectionValue *out_value)
Project chart coordinates into a value surface.
SimPlaneProjectionKind
Projection modes used to reduce chart coordinates to output values.
Definition plane_chart.h:35
@ SIM_PLANE_PROJECTION_SECONDARY
Definition plane_chart.h:38
@ SIM_PLANE_PROJECTION_FULL
Definition plane_chart.h:36
@ SIM_PLANE_PROJECTION_PRIMARY
Definition plane_chart.h:37
void sim_plane_projection_normalize(SimPlaneProjectionConfig *projection)
Normalize a projection config in-place.
unsigned int sim_plane_chart_capability_flags(const SimPlaneChartConfig *chart)
Numerical capability flags currently exposed for a chart configuration.
SimPlaneChartWrapPolicy
Wrapping policies for secondary chart coordinates.
Definition plane_chart.h:44
@ SIM_PLANE_CHART_WRAP_UNSIGNED_ANGLE
Definition plane_chart.h:47
@ SIM_PLANE_CHART_WRAP_SIGNED_ANGLE
Definition plane_chart.h:46
@ SIM_PLANE_CHART_WRAP_UNIT_INTERVAL
Definition plane_chart.h:48
@ SIM_PLANE_CHART_WRAP_NONE
Definition plane_chart.h:45
SimPlaneChartStatus sim_plane_chart_eval(const SimPlaneSamplingFrame *frame, const SimPlaneChartConfig *chart, double x, double y, double t, SimPlaneChartCoord *out_coord)
Evaluate the chart coordinates at the provided sample-space point.
void sim_plane_sampling_frame_normalize(SimPlaneSamplingFrame *frame)
Normalize a sampling frame in-place.
void sim_plane_chart_normalize(SimPlaneChartConfig *chart)
Normalize a plane-chart config in-place.
SimPlaneChartStatus sim_plane_chart_eval_projected(const SimPlaneSamplingFrame *frame, const SimPlaneChartConfig *chart, const SimPlaneProjectionConfig *projection, double x, double y, double t, SimPlaneProjectionValue *out_value)
Convenience wrapper for chart evaluation followed by projection.
SimPlaneChartStatus sim_plane_chart_from_stimulus_coord(const SimStimulusCoordConfig *coord, SimPlaneSamplingFrame *out_frame, SimPlaneChartConfig *out_chart, SimPlaneProjectionConfig *out_projection)
Build a frame/chart/projection triple from a legacy stimulus coord config.
unsigned int sim_plane_chart_semantic_flags(const SimPlaneChartConfig *chart)
Semantic metadata flags for a chart configuration.
Parameters selecting and shaping a reusable 2D plane chart.
Definition plane_chart.h:90
double ellipse_v
Definition plane_chart.h:95
double spiral_angular_velocity
Definition plane_chart.h:99
double rotation
Definition plane_chart.h:93
double ellipse_u
Definition plane_chart.h:94
double spiral_phase
Definition plane_chart.h:98
SimPlaneChartWrapPolicy secondary_wrap
Definition plane_chart.h:92
SimPlaneChartKind kind
Definition plane_chart.h:91
double spiral_pitch
Definition plane_chart.h:97
double spiral_arms
Definition plane_chart.h:96
Pair of primary and secondary coordinates produced by a plane chart.
Definition plane_chart.h:112
double secondary
Definition plane_chart.h:114
double primary
Definition plane_chart.h:113
Projection policy for reducing chart coordinates to stimulus values.
Definition plane_chart.h:105
SimPlaneProjectionKind kind
Definition plane_chart.h:106
Projected chart value with an optional secondary coordinate.
Definition plane_chart.h:120
double primary
Definition plane_chart.h:121
double secondary
Definition plane_chart.h:122
bool has_secondary
Definition plane_chart.h:123
Sampling frame that maps field sample coordinates into chart input space.
Definition plane_chart.h:76
double spacing_y
Definition plane_chart.h:80
double velocity_x
Definition plane_chart.h:83
double velocity_y
Definition plane_chart.h:84
double spacing_x
Definition plane_chart.h:79
double center_x
Definition plane_chart.h:81
double origin_x
Definition plane_chart.h:77
double origin_y
Definition plane_chart.h:78
double center_y
Definition plane_chart.h:82
Shared coordinate mapping configuration used by stimulus operators.
Definition coords.h:53