Example Code

Cross Product of Two 3x1 Vectors Using LabVIEW

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 VI calculates the vector cross product of two 3x1 vectors.

 

Description

Cross product is perpendicular to A Vector and B Vector. The following figure shows A Vector, B Vector, and Cross product of A x B.

 

 

The VI uses the following equation to calculate the cross product of A x B:

 

 

Ax, Ay, and Az are x-, y-, and z-coordinates of A Vector. Bx, By, and Bz are x-, y-, and z-coordinates of B Vector.

x,y and z are unit vectors in Euclidean space.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Enter the x-, y-, and z- coefficients of vectors A and B into the defined arrays.

2. Run the VI and observe the resulting cross product.

 

Additional Information or Resources

 2012.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.

Comments
Todd S.
NI Employee (retired)
on

Thanks for posting! Could you rename your attachment to include the LabVIEW version? "_lvXX.vi" would be fine.

Todd S.
LabVIEW Community Manager
National Instruments
altenbach
Knight of NI Knight of NI
Knight of NI
on

The cross product is included in LabVIEW 2009 and newer.