Example Code

Using rotational matrices to find the location of a point in a new coordinate system using both matrices and arrays

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This example implements a rotational matrix to give the location of a point in a new coordinate system, given the origin and angle of rotation of the new system, in the method using matrices and arrays.

Description

The following example implements a rotational matrix to give the location of a point in a new coordinate system, given the origin and angle of rotation of the new system.  I've included the method to do this using arrays, for versions of LabVIEW prior to the introduction of matrices (pre-2009).

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Give the origin point (Your X and Your Y) and angle of rotation (Rotation Angle(deg)) and new point(NewX and NewY)
  2. Run the VI and the Coordinate position in the updated system control will give the result.
  3. The steps are the same in system 2 on the right.

 

Additional Information or References

Front Panel

3.PNG

 

VI Snippet

2.png

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.