Example Code

Determine if a Point is Located Inside a Triangle in 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

Overview

This VI calculates whether a specified point lies in the triangle defined by three points.

 

Description

This VI will take three points describing a triangle on a cartesian plane and determine if a point is located inside that triangle or not.

 

Requirements

  • LabVIEW 2013 (or compatible).

 

Steps to Implement or Execute Code

  1. Unzip the attached zip file
  2. Open the project and open checkTriangle.vi
  3. Enter the points describing your triangle and the point you wish to check.


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

 

-Jim B
Applications Engineer, National Instruments
CLD, CTD

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