Distance from points to a hyperbola

版本 1.1.0.0 (2.7 KB) 作者: Hui Ma
Projects a set of points onto a hyperbola and returns the nearest points on the hyperbola
564.0 次下载
更新时间 2011/1/17

查看许可证

This is an adaptation of the projecting method for ellipse introduced by D. Eberly.
Internet publication: "Distance from a point to an ellipse in 2D" (2004) Geometric Tools, LLC, www.geometrictools.com
Book publication: "3D Game Engine Design", 2nd edition.
Morgan Kaufmann Publishers, San Francisco, CA, 2007.
(see Section 14.13.1)

Usage: [RSS, XYproj] = Residuals_hyperbola(XY,ParG)
Input: XY(n,2) is the array of coordinates of n points
x(i)=XY(i,1), y(i)=XY(i,2)
ParG is a vector 5x1 of the hyperbola parameters
ParG = [Center(1:2), Axes(1:2), Angle]'
Center - the coordinates of the hyperbola's center
Axes - the axes (major, minor)
Angle - the angle of tilt of the hyperbola
Note: if hyperbola is defined by equation
x^2/a^2-y^2/b^2=1,
then Center=(0,0),Axes=(a,b),Angle=0

Output: RSS is the Residual Sum of Squares (the sum of squares of the distances)
XYproj is the array of coordinates of projections

This algorithm is proven to converge and reaches an accuracy of 7-8 significant digit. It takes 6-7 iterations per point, on average

引用格式

Hui Ma (2024). Distance from points to a hyperbola (https://www.mathworks.com/matlabcentral/fileexchange/27709-distance-from-points-to-a-hyperbola), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2008a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

This updated version has a modification in line 37.

1.0.0.0