06-08-2010 12:01 PM - edited 06-08-2010 12:02 PM
Just curious why this isn't making the "saddle" shape like it should. Just playing around and expanding my knowledge so this isn't exactly in need of a "high priority" response. I'm going for the equation y = x^4-z^4.
Also, while I'm at it, why does the Z array take 2-d data. It makes sense...but at the same time it doesn't make sense (at least in my head haha).
Solved! Go to Solution.
06-08-2010 12:04 PM
06-09-2010 01:22 PM
You almost have it right. In order to have the correct Z array, you need to change the data of x and y independently. This snippet should give you the proper graph.
06-09-2010 01:40 PM - edited 06-09-2010 01:43 PM
Scott W wrote:You almost have it right. In order to have the correct Z array, you need to change the data of x and y independently. This snippet should give you the proper graph.
Could you explain in a little more detail why this is? For some reason I'm having trouble wrapping my head around it.
I think I am thinking too much "equation" and not enough "array's it's producing"06-09-2010 01:53 PM
Nevermind, I think I got it. You need to say ok, when y is -5 and x is -5,-4,-3... what is z for each of those values. Then store it in an array. Then when y is -4 and x is -5,-4,-3... what are the z values etc, etc
Anyways, thanks for the solution!
06-09-2010 03:32 PM
06-10-2010 09:46 AM
Let's keep with the theme of plotting 3D graphs incorrectly. Simple sphere using cartesian coordinates. Don't know what to do about the imaginary numbers. Apparently 2 years after getting a Purdue Engineering degree, I can't do Engineering anymore. Or my brain just is having trouble thinking this way. Or...I like to make excuses.
I found an example with active x plots, but I am trying to stick with this newer surface plot.
Feel free to use spherical coordinates if you want.
06-10-2010 10:14 AM
06-11-2010 04:30 PM
Hey!
I've been working on this on and off throughout the day and haven't quite figured it out but was able to figure a few things out.
To work with imaginary numbers LabVIEW has a complex data type. You can change all of your data types to be this by right clicking on your data and selecting Representation»Complex Double. This will allow you to make calculations using imaginary numbers.
As for plotting the sphere correctly, I haven't been able to completely figure it out but I did do the following and it got me a bit closer.
Instead of starting from -4 to create the axis range, I started from -5 and changed the number of iterations to 11. This gave me a choppy graph so I increase the number of iterations (101) and changed the axis step size from 1 to .1089. This gave me a sphere with a plane in the middle. I didn't quite figure out how to get rid of the plane, but thought I would share what I've done when troubleshooting this issue.
I'll try working on it again on Monday if I have time. I hope you enjoy your weekend!