Triangle
Equilateral, isosceles and scalene triangles, with the apex up.
Every side has to have a length, and the sides have to satisfy the triangle inequality. A factory given sides that cannot make a triangle refuses with an IllegalArgumentException.
import smile.colors.PresetColor.*
val triangle = Triangle(80, fillWith(SeaGreen), None)

Attributes
- Source
- Shapes.scala
- Graph
-
- Supertypes
- Self type
-
Triangle.type
Members list
Value members
Concrete methods
An equilateral triangle with sides of sideLength, centered at the origin.
An equilateral triangle with sides of sideLength, centered at the origin.
Attributes
- Source
- Shapes.scala
An equilateral triangle with sides of sideLength, its box centered at center.
An equilateral triangle with sides of sideLength, its box centered at center.
Attributes
- Source
- Shapes.scala
An isosceles triangle with two sides of sideLength over a base of baseLength, centered at the origin.
An isosceles triangle with two sides of sideLength over a base of baseLength, centered at the origin.
Attributes
- Source
- Shapes.scala
An isosceles triangle with two sides of sideLength over a base of baseLength, its box centered at center.
An isosceles triangle with two sides of sideLength over a base of baseLength, its box centered at center.
Attributes
- Source
- Shapes.scala
A triangle with the given base and sides, the left side rising from the base's left end, centered at the origin.
A triangle with the given base and sides, the left side rising from the base's left end, centered at the origin.
Attributes
- Source
- Shapes.scala
A triangle with the given base and sides, the left side rising from the base's left end, its box centered at center.
A triangle with the given base and sides, the left side rising from the base's left end, its box centered at center.
Attributes
- Source
- Shapes.scala
An equilateral triangle height high, centered at the origin.
An equilateral triangle height high, its box centered at center.
An isosceles triangle height high over a base of baseLength, centered at the origin.
An isosceles triangle height high over a base of baseLength, centered at the origin.
Attributes
- Source
- Shapes.scala
An isosceles triangle height high over a base of baseLength, its box centered at center.
An isosceles triangle height high over a base of baseLength, its box centered at center.
Attributes
- Source
- Shapes.scala
Concrete fields
The height of an equilateral triangle as a multiple of its side.
The side of an equilateral triangle as a multiple of its height.
