CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
Point2D Struct Reference

Simple 2D point structure. More...

#include <spatial_interpolation.h>

Public Member Functions

 Point2D (double x_=0, double y_=0)
 

Data Fields

double x
 
double y
 

Detailed Description

Simple 2D point structure.

Spatial Interpolation Using k-Nearest Neighbors and Inverse Distance Weighting

This header defines classes for fast spatial interpolation using:

  • k-d tree spatial indexing (nanoflann library)
  • Inverse Distance Weighting (IDW)
  • OpenMP parallelization

CLASSES:

QUICK START:

std::vector<Point2D> points = {{0,0}, {10,0}, {5,10}}; std::vector<double> values_x = {1.0, 2.0, 1.5}; std::vector<double> values_y = {0.5, 1.0, 0.8}; DualSpatialInterpolator interp(points, values_x, values_y, 12, 2.0); std::vector<Point2D> query = {{5,5}}; std::vector<double> result_x, result_y; interp.Interpolate(query, result_x, result_y);

TUNING PARAMETERS:

  • k_neighbors (default 12): Number of nearest points to use
    • Increase for smoother results
    • Decrease for more local detail
  • power (default 2.0): IDW power exponent
    • Increase for sharper transitions (nearby points dominate)
    • Decrease for smoother transitions (distant points have more influence)

Definition at line 48 of file spatial_interpolation.h.

Constructor & Destructor Documentation

◆ Point2D()

Point2D::Point2D ( double x_ = 0,
double y_ = 0 )
inline

Definition at line 51 of file spatial_interpolation.h.

Field Documentation

◆ x

double Point2D::x

Definition at line 50 of file spatial_interpolation.h.

Referenced by Point2D().

◆ y

double Point2D::y

Definition at line 50 of file spatial_interpolation.h.

Referenced by Point2D().


The documentation for this struct was generated from the following file: