triangle()
Triangle - Draws a triangle with the given inputs
Example
Syntax
Input | Description |
---|---|
x1 | x co-ordinate of the left corner |
y1 | y co-ordinate of the left corner |
x2 | x co-ordinate of the middle corner |
y2 | y co-ordinate of the middle corner |
x3 | x co-ordinate of the right corner |
y3 | y co-ordinate of the right corner |
Description
triangle() draws a triangle on the canvas, using the inputs to determine the positions of the 3 corners. Even though this is the simplest 2D shape, it takes the most complicated form of input, since total freedom to specify the shape is given.
Find these documents helpful? Let the people who made them help your child learn to code at Strivemath!
We'd love to hear your Feedback/Comments here.
Last updated