Description
This function plots hyperbolas with configurable centre position, foci positions, transverse and conjugate axis lengths, limit of major axis, and rotation angle.
Syntax
- PlotHyperbola plots default hyperbola.
- PlotHyperbola(Name,Value) specifies parameters using name-value pair arguments.
- B = PlotHyperbola(___) returns an 4-D array of 2-by-N-by-2. The third dimension reperents the branch number. The second dimension represents the point number on each branch. The first dimension represents the 2-D coordinates of each point.
Input Name-Value Pair Arguments
- Centre - The centre coordinates of the hyperbola, specified as a 2-D vector. Default [0,0].
- a - Length of half transverse axis. Default 1.
- b - Length of half conjugate axis. Default 0.25.
- MajorAxis - Major axis, 'x' or 'y'. Default 'x'.
- N - The number of points to plot. Default 1000.
- Rotation - Counter-clockwise rotation in degrees. Default 0.
- MajorLim - Limit of major axis. Default 2a, i.e., the length of transverse axis.
- Plot - Flag indicating whether plot the hyperbola. Default true.
- axes - Handle of axes to plot on. When not specified, the function will create one
- Foci - A cell array of foci positions. Each cell contains the 2-D coordinates of a focus. When this parameter is specified, the funciton uses Foci along with a to compute and overwrite Centre, Rotation, and b.
Example
PlotHyperbola
PlotHyperbola('Rotation',30, 'Centre',[2,5],'MajorLim',3,'a',1,'b',1)
Cite As
Yuxiao Zhai (2024). PlotHyperbola (https://www.mathworks.com/matlabcentral/fileexchange/110750-plothyperbola), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2021a
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.