Dart Documentationsimple_featuresTriangle

Triangle class

A Triangle is a polygon with 3 distinct, non-collinear vertices and no interior boundary.

class Triangle extends Polygon {

 /**
  * Creates a triangle with the [exterior].
  *
  * [exterior] must be a non-null, closed linestring with exactly three
  * distinct, non-colienar points.
  *
  * Throws [ArgumentError] if the preconditions aren't met.
  */
 Triangle(LineString exterior) : super.triangle(exterior);
}

Extends

Geometry > Surface > Polygon > Triangle

Constructors

new Triangle(LineString exterior) #

Creates a triangle with the exterior.

exterior must be a non-null, closed linestring with exactly three distinct, non-colienar points.

Throws ArgumentError if the preconditions aren't met.

Triangle(LineString exterior) : super.triangle(exterior);

Properties

final double area #

inherited from Surface

The area of this Surface, as measured in the spatial reference system of this Surface.

@specification(name:"area()")
double get area;

final String asText #

inherited from Geometry

A WKT representation of the geometry

@specification(name:"asText()")
String get asText {
 var buffer = new StringBuffer();
 var writer = new _WKTWriter(buffer);
 _writeTaggedWKT(writer, withZ: is3D, withM: isMeasured);
 return buffer.toString();
}

final Geometry boundary #

inherited from Polygon

Returns the closure of the combinatorial boundary of this geometric object

docs inherited from Geometry
@override Geometry get boundary {
 if (isEmpty) return new MultiLineString.empty();
 if (interiorRings.isEmpty) return exteriorRing;
 var rings = [];
 rings.add(exteriorRing);
 rings.addAll(interiorRings);
 return new MultiLineString(rings);
}

final Point centroid #

inherited from Surface

The mathematical centroid for this Surface as a Point. The result is not guaranteed to be on this Surface.

@specification(name:"centroid()")
Point get centroid;

final dimension #

inherited from Surface

The inherent dimension of this geometric object, which must be less than or equal to the coordinate dimension. In non-homogeneous collections, this will return the largest topological dimension of the contained objects.

docs inherited from Geometry
@override get dimension => 2;

final LineString exteriorRing #

inherited from Polygon

The exterior ring of this polygon.

Replies an empty linestring if this polygon is empty.

@specification(name:"exteriorRing()")
LineString get exteriorRing => _exterior == null
 ? new LineString.empty()
 : _exterior;

final String geometryType #

inherited from Polygon

Returns the name of the instantiable subtype of Geometry of which this geometric object is an instantiable member. The name of the subtype of Geometry is returned as a string.

docs inherited from Geometry
@override String get geometryType => "Polygon";

final Iterable<LineString> interiorRings #

inherited from Polygon

The interior rings. Replies an empty iterable, if this polygon doesn't have interior rings.

Iterable<LineString> get interiorRings => _interiors== null
   ? []
   : _interiors;

final bool is3D #

inherited from Polygon

Replies true if this polygon isn't empty and if both the exterior and each of the interior rings are 3D.

@override bool get is3D {
 bool ret = _exterior == null ? false : _exterior.is3D;
 if (interiorRings.length == 0) return ret;
 ret = ret && interiorRings.every((r) => r.is3D);
 return ret;
}

final bool isEmpty #

inherited from Polygon

Returns 1 true if this geometric object is the empty Geometry.

docs inherited from Geometry
@override bool get isEmpty => _exterior == null;

final bool isMeasured #

inherited from Polygon

Replies true if this polygon isn't empty and if both the exterior and each of the interior rings are measured.

@override bool get isMeasured {
 bool ret = _exterior == null ? false : _exterior.isMeasured;
 if (interiorRings.length == 0) return ret;
 ret = ret && interiorRings.every((r) => r.isMeasured);
 return ret;
}

final bool isSimple #

inherited from Geometry

Returns true if this geometric object has no anomalous geometric points, such as self intersection or self tangency.

@specification(name:"isSimple()")
bool get isSimple;

final int numInteriorRing #

inherited from Polygon

the number of interior rings

@specification(name:"numInteriorRing()")
int get numInteriorRing => _interiors == null
 ? 0
 : _interiors.length;

final Point pointOnSurface #

inherited from Surface

A Point guaranteed to be on this Surface.

@specification(name:"pointOnSurface()")
Point get pointOnSurface;

int get SRID #

inherited from Geometry

Returns the Spatial Reference System ID for this geometric object.

@specification(name:"srid()")
int get SRID => _srid;

dynamic set SRID(int value) #

inherited from Geometry

the Spatial Reference System ID for this geometric object.

set SRID(int value) => _srid = value;

Methods

LineString interiorRingN(int n) #

inherited from Polygon

Replies the n-th interior ring.

Throws a RangeError if n is out of range

@specification(name:"interiorRingN()")
LineString interiorRingN(int n) => interiorRings.elementAt(n);