HighMap library (C++)
Loading...
Searching...
No Matches
point.hpp File Reference

Defines a class for representing and manipulating 3D points. More...

Go to the source code of this file.

Classes

class  hmap::Point
 A class to represent and manipulate 2D points that can carry a value. More...
 

Namespaces

namespace  hmap
 

Functions

float hmap::angle (const Point &p1, const Point &p2)
 Computes the angle between two points relative to the x-axis.
 
float hmap::angle (const Point &p0, const Point &p1, const Point &p2)
 Computes the angle formed by three points with the reference point as the origin.
 
float hmap::cross_product (const Point &p0, const Point &p1, const Point &p2)
 Computes the 2D cross product of vectors formed by three points.
 
float hmap::curvature (const Point &p1, const Point &p2, const Point &p3)
 Calculates the curvature formed by three points in 2D space.
 
float hmap::distance (const Point &p1, const Point &p2)
 Calculates the distance between two points.
 
Point hmap::interp_bezier (const Point &p_start, const Point &p_ctrl_start, const Point &p_ctrl_end, const Point &p_end, float t)
 Performs a cubic Bezier interpolation.
 
Point hmap::interp_bspline (const Point &p0, const Point &p1, const Point &p2, const Point &p3, float t)
 Performs a cubic B-spline interpolation.
 
Point hmap::interp_catmullrom (const Point &p0, const Point &p1, const Point &p2, const Point &p3, float t)
 Performs a Catmull-Rom spline interpolation.
 
Point hmap::interp_decasteljau (const std::vector< Point > &points, float t)
 Performs a De Casteljau algorithm-based interpolation for Bezier curves.
 
Vec4< float > hmap::intersect_bounding_boxes (const Vec4< float > &bbox1, const Vec4< float > &bbox2)
 Determines the intersection of two bounding boxes.
 
bool hmap::is_point_within_bounding_box (Point p, Vec4< float > bbox)
 Checks if a point is within a specified bounding box.
 
bool hmap::is_point_within_bounding_box (float x, float y, Vec4< float > bbox)
 Checks if a point is within a specified bounding box.
 
Point hmap::lerp (const Point &p1, const Point &p2, float t)
 Linearly interpolates between two points.
 
Point hmap::midpoint (const Point &p1, const Point &p2, int orientation, float distance_ratio, float t=0.5f)
 Computes the midpoint displacement in 1D with a perpendicular displacement.
 
void hmap::sort_points (std::vector< Point > &points)
 Sorts a vector of points in ascending order based on their coordinates.
 
float hmap::triangle_area (const Point &p1, const Point &p2, const Point &p3)
 Calculates the area of a triangle formed by three points in 2D space.
 
Vec4< float > hmap::unit_square_bbox ()
 Constructs a 4D bounding box for a unit square.
 

Detailed Description

Defines a class for representing and manipulating 3D points.

Author
Otto Link (otto..nosp@m.link.nosp@m..bv@g.nosp@m.mail.nosp@m..com)

This file contains the definition of the Point3 class, which represents a point in 2D space with x, y, carrying a vlue v. The class includes basic vector operations such as addition, subtraction, and scalar multiplication. It also provides functionality for linear interpolation between two points.

Version
0.1
Date
2023-06-18

This software is distributed under the terms of the GNU General Public License. The full license is in the file LICENSE, distributed with this software.