Effectiveness of the Cartesian to spherical coordinate of the conversion

I use a VI in the LV 2014 distribution called ".vi NI_AALPro.lvlib:3D Conversion of coordinates (scalar)". It uses DBL inputs and outputs and has several functions of table build in it as a library function call. I need to make a massive number of Cartesian to spherical conversions with SGL values, and so I would like to re - write this VI using LV primitives most efficiant manner.

The calculation seems to be pretty simple, and I've attached a VI that does this. However, there is a problem with the calculation of the polar angle. From what I've read online, this is just arctan (y / x), but I get incorrect values when x is negative (but not when there is negative).

From what I've read on the site of Wolfram, "the inverse tangent must be properly set to the right quadrant of (x / y) into account." I searched online for more details on the calculation, but I'm lost. Any trig works there who can help me?

Definitions are extremely important in the definition of coordinate systems.  You include with your VI Cart_to_Sph documents of many errors and inconsistencies.

This is a convention that I use and which seems to be acceptance quite wide (I'm not sure that's the convention of Wolfram, however).

Let X, Y and Z is a right coordinate system.  That P is a point whose X, Y, Z coordinates we know.  Define a system of spherical polar coordinates (SSC) as follows:

  • Project of a line from the origin to P.
  • RADIUS (rho) - length of the line from the origin to P.
  • The line of the project on the X - Y plane.
  • Azimuth (theta) - measured Angle to the left of the x-axis for this proposed line.  By convention, theta varies less pi (radians), pi.
  • Polar angle (phi) - the angle between the axis Z (or 'pole') and the line from the origin to P.  By convention, including phi between 0 and pi.

Under this system of coordinates, the following code (very similar to Altenbach, which uses a slightly different coordinate system) cards X, Y, Z in Rho, Theta, Phi:

We will check certain quantities of 'known '.  Start with the x-axis of the unit, [1, 0, 0].  This clearly has length, Rho = 1.    The X axis lies in the XY, so the angle between the latter and the Z axis is 90 °, Phi should be pi/2.  Finally, the projection of the X axis in the XY plane is located along the X axis, so the angle between the two axes of X is 0, so Theta should be 0.  The first Re / Im polar will give 1, Theta Yes 0 = 0.  The second will give 1, pi/2, and Yes 1 = Rho and Phi = pi/2.

How about unit Z, [0, 0, 1]?  Again, the length, Rho, is 1.  Technically, since the z plans on the origin, the Azimuthal angle cannot be properly defined (the X coordinates and are 0), so we'll do a loophole 'math' and just say that it is zero.  The polar angle is easy - the angle between the Z axis and the pole, the Z axis is 0, so Phi = 0.  Now "do the math".  Put [0, 0] in the first Re / Im polar gives [0, 0], so theta = 0.  The second d / Im to polar takes [1, 0] [1, 0], Rho Yes = 1 and Phi = 0.

It is easy to show (in particular by the coding of this place and put in test of numbers) that negative quantities are working properly.  Rho is always non-negative, Phi is always in the range 0... PI and theta of pi-pi, with the sign depends on the sign of Y (as it should).

Bob 'just do the math' Schor

PS - If you think this is fun, just try 3D rotation matrices...

Tags: NI Software

Similar Questions

  • How to make a transformative effect ignore the line attributes?

    Hi all

    I am intermediate (at best) with Illustrator. I use CS6 on an iMac 2009.

    Could someone advise me on how to make Illustrator ignore STROKE weight/CAP/join parameters when I apply a live effect make rotate/multiple copy on a group of paths? Currently, Illustrator defines the rotation point to the extreme point of my stroke (contained in the atrributes of traits), but I want only to calculate the track structure: the coordinates of my anchor point designated.

    Screen shot 2012-10-16 at 12.04.07 PM.png

    Here are the top/right of paths with a rotation Group / 3 copies effect of 90 degrees. This view looks without problem.

    Screen shot 2012-10-16 at 12.04.24 PM.png

    This band of the top/right of the railways with the addition of a reflection / 1 copy effect of the x-axis. Still no apparent problem.

    Screen shot 2012-10-16 at 12.05.13 PM.pngScreen shot 2012-10-16 at 1.20.14 PM.png

    But this is a close to the alignment of the corner points. As shown, the transformation indeed is based on attributes of the strokes (the tip of his corner), not the actual location of the corner point.

    It does not help to apply styles different heading a corner or race alignments; that only slightly Wizz the pivot point to the Center.

    In addition, this race of a point is somewhat arbitrary. I only put it so in order to see my dynamic effects.

    Refine vertical and horizontal effects of the elements turned/copied movements won't help because this art will subsequently undergo a lot of alteration, changing money, especially in the weight of the stroke (thickness of the line maybe same variable).

    I need the skeleton of the struct to snap together precisely.

    Any solution, regardless of how roundabout, would save this project! I'd appreciate some advice.

    Assuming that you did clean:

    1. check the order of the effects and strokes: this is important if you first apply the effect, then the stroke or vice versa

    2. check that "Snap to grid of pixels" is turned on

  • How to get the text have the same effect as the video?

    Hello

    For the first time post here, but I wonder how to get the text of the titles have the same effect as the video behind her.

    For my video, I use 'bad tv' and other effects such as Gaussian that obviously changes the appearance of video, creating the look of VHS. However, I then inserted text via the title, but it normally appears. How can I make this text have the same effects as the video behind it?

    A friend told me I might need to add text to the video first, then do the effects, I have not tried, but wonder if there is an easier way, as this would require me to restart.

    EDIT: That's what I'm looking for. https://youtu.be/7_2PHQI89dI?t=24s The text has the same effect as the video.

    Thank you

    One way is to create a clip made up based on the title and the original clip. Then apply the effect.

    Another way is to use an adjustment layer.

    Good luck.

    Russ

  • It's good to put in glass on screen? is - that may decrease the effectiveness of the screen?

    friends, I brought 6 s more. It's good to put in glass on screen? is - that may decrease the effectiveness of the screen?

    < re-titled by host >

    It could cause your iPhone overheating which may also void the warranty.

  • What are the effects of the clearing the browser Cache?

    What are the effects of the clearing the browser Cache?

    Caches to store a copy of the page Web that you visit to speed up the loading of the page even when you revisit the page.

    Once you empty the Caches, pages must be again downloaded from Web sites.

    With higher bandwidth available now, is not a problem.

    Sometimes these caches can get damaged and a troubleshooting step

    You can clear those without causing any problems.

  • If I delete a song in the list of duplicates itunes, it has an effect on the existing playlist?

    If I delete a song in the list of duplicates itunes, it has an effect on the existing playlist?

    Official notice of Apple on the duplicates is here: find and remove duplicates in your iTunes library. This is a manual process and article fails to explain some of the potential pitfalls such as the lost coast and membership of playlist, or sometimes the same file can be represented by multiple entries in the library as well as a removal and recycling the file will break all the others.

    Use MAJ > view > show items to reproduce exactly to display the duplicates because it is normally a selection more useful. You must manually select all but one of each group to remove. Sort the list by Date added can make easier select appropriate tracks, but it works better when executed immediately after the dupes were created.  If you have several entries in iTunes connected to a same file on the disk hard then don't not send to trash.

    Use my DeDuper script (Windows only) If you are not sure, do not want to do it by hand, or want to maintain ratings, play counts and playlist membership. See this background thread , this post for detailed instructions and Please take note of the warning toback up your library before deduping.

    (If you don't see the menu bar press ALT to temporarily view or CTRL + B to keep displayed.)

    The latest version of the script can put away the dead links as long as there is at least a double live to merge his stats and membership of the playlist and must deal wisely when the same file has been added through multiple paths.

    With this many files, it might pay to break down the problem into smaller pieces.

    TT2

  • Smart battery business effects on the phone battery?

    Hello

    What is your contribution regarding the effects of the case continually recharges the phone?

    First of all, I'm confused that the case feeds the case when the phone is 100% or if it is just trickle charge the phone and keep it 100%. I read a few articles such as (http://fortune.com/2015/12/14/apple-iphone-battery-case-review/) saying that the case battery fully powers the phone. However, I have reason to believe that the case is simply trickle charge the phone.

    If the case was simply charging the phone on charge of compensation, he would have no adverse effects on the long-term phone battery? As (http://www.powerstream.com/li.htm) and (http://batteryuniversity.com/learn/article/charging_lithium_ion_batteries) does point out that trickle charge a Li-ion battery can have negative effects on the battery. I much prefer fresh case of how Mophie battery, I can turn it on when I want to and end it before 100%, but I prefer by far holding the handle of the smart case in my hands.

    The management of the battery of the phone is very smart. When the battery reaches 100%, it stops to load. Completely. When the phone is 100% power is connected powering the phone, and the battery is ignored. If you could leave it plugged into the wall for weeks without interruption, and it wouldn't hurt anything. In fact, you SHOULD leave plugged in overnight, every night and allow automatic backups iTunes via WiFi or iCloud. In this way the most you can lose is a day data.

    As a result, the case feeds the phone up to exhausts its battery, then the battery takes over. If the battery is not fully charged when you connect the case he will first charge the battery.

  • Updates to Windows during the stoppage has not taken effect and the same updates (16 of them) keep coming back in the next restart.

    Original title: Windows updates has not taken effect.

    My Windows updates during the shutdown did not effect. The same updates (16 of them) keep coming back in the next restart.

    I tried fixed it 50461 mentioned in one post, but the problem persists.

    Any help to appreciate.

    Hi Lee CC,.

    1 windows operating system you are using?

    2. you receive an error code or error messages?

    3. Why have you tried the Fixit 50461? Have you received a 646 error?

    This problem can occur if updates failed to install.

    Method 1:

    You can read the following article and try to reset the Windows Update components and check.

    How to reset the Windows Update components?

    http://support.Microsoft.com/kb/971058

    Method 2:

    You can also read the following article and check if it helps.

    Troubleshooting Windows Update or Microsoft Update when you are repeatedly offered an update

    http://support.Microsoft.com/kb/910339

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Strobe effect of the ThinkPad T520 screen

    I have a ThinkPad T520 with installed Optimus graphics. I noticed that the screen has a sort of strobe effect, maybe the strobe effect isn't the best word, but basically what it does is you can see lines of light moving toward the bottom of the screen very quickly. It is most visible on the blue background of "Microsoft" by default.

    I tried to reinstall my graphic drivers, Optimus disabling and turning the refresh rate to 60 Hz, not good.

    After further tests, it seems to be more noticeable in the middle to low light. At full intensity, you don't notice the issue more.

    I looked around online, something about the inverter may be bad? The guarantee would cover this?

    Edit: Called support, they will replace the LCD unit.

  • I am running winXP home on laptop wireless via a router, and I continue to have an effect on the net.

    login procedure

    I am running winXP home on laptop wireless via a router and I continue to have an effect on the net, and a window saying I need to go through a certain procedure of connectivity in order to return on the net than what seems to come regularly and after that I went through the procedure, I'm back on the net could you please inform me how to eliminate this problem.

    Hi conorcloris,

    ·         What is the exact error message?

    ·         Did you do changes on the computer before the show?

    Follow the steps in the article.

    How to troubleshoot a network home in Windows XP

    http://support.Microsoft.com/kb/308007

    In Windows network connection issues

    http://support.Microsoft.com/kb/313242/en-us

    Troubleshooting Internet connection sharing in Windows XP

    http://support.Microsoft.com/kb/308006/en-us

  • everytime I have start watching videos sreaming they all start as they should, but later, they get real slow and it the effects of the performanced spped PC

    everytime I have start watching videos sreaming they all start as they should, but later, they get real slow and it the effects of the performanced spped PC

    Hello

    1 how long have you been faced with this problem?
    2. don't you make changes on the computer before this problem?
    3. what browser do you use?

    In response to the questions above could help us help you better. However, you check to see if the problem persists in the clean boot state.

    From your computer by using a minimal set of drivers and startup programs so that you can determine if a background program is interfering with your game or program. This type of boot is known as a "clean boot".

    Reference:

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:

    1. click on start and then click Run.

    2. type msconfig and click OK.

    The System Configuration Utility dialog box appears.

    3. click on the tab general, click Normal Startup - load all services and device drivers and then click OK.

    4. When prompted, click on restart to restart the computer.

  • each program loading has a blur transparency effect with the office showing behind. How can I recreate this effect?

    I want to use this effect on my Web site at the beginning of a slide show.  photos will move under this effect to the very fuzzy search then go out under the layer and be at the point.  Thanks much for any help!

    Hello

    You can try to search using your favorite search engine and search for fonts or effects you need to create your web page. If you don't know what to look for, then look at the name of your desktop theme and seek with him.

  • Windows Defender: "" this operation has been cancelled due to restrictions in effect on the computer, contact your system administrator ""

    original title: windows Defender

    I am a beginner and need help. I uninstalled net protect + because it wasn't, not with BT which were unnecessary, but thanks to a member of the forum. Net + had problems trying to reinstall Protect so therefor I installed internet security essentials and now windows Defender does not work! When I try to open the message reads "this operation has been cancelled due to restrictions in effect on the computer, contact your system administrator" can someone help me with this problem. The system is windows vista Home premium.

    Have you installed Microsoft Security Essentials (MSE)? If so, you need not and should not run Windows Defender.  MSE does all what does Windows Defender and much more. Boulder computer Maven
    Most Microsoft Valuable Professional

  • Holding an effect until the display

    Hi people,

    I have a slide with three buttons. I use advanced actions to display different information for each click of a button. It works fine, except that I can't use any entry effects when they proved the information. I suspect it's because the effect has already played, but because the information was hidden you cannot see it. So my question is does anyone know a way to maintain the effect until the button is pressed?

    See you soon,.

    Steve

    Nevermind, I just answered my own question :)

    See you soon

    Steve

  • Missing effects in the effects tab

    I have Illustrator CC 2015.3 and I am currently taking a class for the program. One of the lesson I have to use < aesthetic < inner glow, but the only thing that appears is fluorescent contours. Other versions of Illustrator, my classmates have seem to have the inner glow, but not mine. I have re-installed the program already but the problem persists. Thanks for your help in advance!

    ---------------------------

    Edit:

    Inner glow on the effects of the Illustrator and Scarlet contours is the impact of photoshop

Maybe you are looking for

  • Netflix does not not on Toshiba 55L7463DN

    Hello I have a problem with netflix on my TVI can connect and browse through titles, but play when I get the message: "We have difficulties in playing this song at the moment. Please try again later or select a different title. All tests are good, an

  • Tecra: Documen Word crashes

    Hello! I work on a word document - that has the text boxes and arrows etc and when I load were not - so I have to reduce and restore, then it shows - how can I avoid this and change it? Thank you!

  • The former World Assembly references

    I created an instrument using NI-VISA driver, and I encountered an error trying to generate a help file for him.  I use c# in VS2008 with VISA 4.6.2 for the driver and file generator help (CodePlex) Sandcastle to generate a release build XML help fil

  • How to create a stop button to send commands via the serial port and finish labview vi?

    I want to send two commands on my camera, the first to stop the execution and the second to get out of the remote control mode. This is done on RS232. What I want is a way to put this in my existing VI that tells the device to run. Now if I stop the

  • help thanks again

    I back up my computer on three tails when I first buy it. can I use then format my labtop. Thank you for the answers