Skip to content

TriangleNode

Overview

Draws an equilateral or isosceles triangle pointing up by default. triangleWidth sets the base, while triangleHeight sets the altitude. The point of the triangle is drawn to be perpendicular from the halfway point of the base.

@author Marla Schulz (PhET Interactive Simulations)

Class TriangleNode

import { TriangleNode } from 'scenerystack/scenery-phet';

Constructor

new TriangleNode( providedOptions? : TriangleNodeOptions )

Instance Methods

Type TriangleNodeOptions

import type { TriangleNodeOptions } from 'scenerystack/scenery-phet';
  • pointDirection?: "up" | "down" | "right" | "left"
  • triangleWidth?: number
  • triangleHeight?: number
  • & StrictOmit<PathOptions, "rotation" | "shape" | "shapeProperty">

Source Code

See the source for TriangleNode.ts in the scenery-phet repository.