From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build an ellipse and plot it

Hello, I want to build a plot and then plot it in a XY graph.
 
I have the two parameters of the ellipse ( a and b) but I haven't find any block to build it. I've used a loop  block to create the two point vectors to send to XY graph, but it spends a lot of time and I want to use something fastly.
 
Do you know if exists a block which calculate a ellipse or some way different from loop.
 
Thank you!
 
Larson
0 Kudos
Message 1 of 21
(12,731 Views)
If you display the elipse as a set of points connected by lines, then you can simply choose the amount of tolerable spherical excess and reduce the number of points plotted. This should allow you to continue to use the loop to generate the elipse. Right click on the plot legend and find options for the point style and the plot style. Spherical excess is sort of like the area between a chord and the edge of a circle. The closer together the two points of the chord are the smaller the spherical excess, and the more the graph will look like a perfect elipse.
0 Kudos
Message 2 of 21
(12,721 Views)
0 Kudos
Message 3 of 21
(12,711 Views)
Hello unclebump,
 
thanks for your help.....I don't know if you've used graph_ellipse.vi, it's run corretctly if the variables a and b are integer numbers but the plot is not completely draw if this variables have a decimal number. Do you know why? How would you try to solve it? 
 
larson
 
0 Kudos
Message 4 of 21
(12,685 Views)
Here is a version for an ellipse centered at zero that will work with decimal values. I'll see if I can make one for an elipse that is translated and rotated. 7.0 format file.
0 Kudos
Message 5 of 21
(12,672 Views)
Use this version. It scales the X and Y based on largest value for a and b values.
0 Kudos
Message 6 of 21
(12,668 Views)
Here is another version that draws the ellipse with a polar equation. You can even change the for loop constant and draw partial ellipses. It also includes rotation of the ellipse and linear translation on each axis. I'm still trying to get the axis ranges to work properly with all of the combinations of +/- translations, largest values,.... 7.0 format.
Message 7 of 21
(12,662 Views)
Often you can avoid all that trigonometry if you use complex math. 😉
 
See how much simpler things get! (LabVIEW 7.0). 😄

Message Edited by altenbach on 09-01-2005 02:07 PM

Message 8 of 21
(12,658 Views)
Actually, you can precompute the unit circle to save some processing. 🙂
See attached modification. (LabVIEW 7.0)
Message 9 of 21
(12,648 Views)
Wow!! NI should include that vi in the examples for v8.
0 Kudos
Message 10 of 21
(12,626 Views)