# PolygonLike

trait PolygonLike[VT]

A Polygon like object with 2 dimensional point vertices, where the points dimensions could be specified in metres, latitude, longitude etc as well as the regular scalar values of the standard Polygon. *

Type Params
VT

The type of the vertices in this polygon like trait. For a standard Polygon this will be a Pt2, but for example for a PolygonMetre3 it would be a PtMetre3.

class Any

## Value members

### Abstract methods

def vert(index: Int): VT

Returns the vertex of the given index. Throws if the index is out of range, if it less than 1 or greater than the number of vertices.

Returns the vertex of the given index. Throws if the index is out of range, if it less than 1 or greater than the number of vertices.

def vertsFold[B](init: B)(f: (B, VT) => B): B

Folds over the vertices.

Folds over the vertices.

Type Params
B

type of the accumulator return value of this method.

def vertsForeach[U](f: VT => U): Unit

Performs the side effecting function on the value of each vertex.

Performs the side effecting function on the value of each vertex.

def vertsIForeach[U](f: (VT, Int) => U): Unit

Performs the side effecting function on the value of each vertex and an index.

Performs the side effecting function on the value of each vertex and an index.

def vertsMap[B, ArrB <: ArrBase[B]](f: VT => B)(implicit builder: ArrBuilder[B, ArrB]): ArrB

Maps the vertices of this polygon to an immutable Array like sequence of type B.

Maps the vertices of this polygon to an immutable Array like sequence of type B.

Type Params
ArrB

The type of the immutable Array like sequence of B.

B

The element type of the returned sequence.

Returns

the immutable sequence collection by applying the supplied function to each vertex.

def vertsNum: Int

The number of vertices and also the number of sides in this Polygon.

The number of vertices and also the number of sides in this Polygon.

### Concrete methods

def map[B <: ElemValueN, BB <: PolygonLike[B]](f: VT => B)(implicit build: PolygonBuilder[B, BB]): BB

Map this collection of data elements to PolygonLike class of type BB.

Map this collection of data elements to PolygonLike class of type BB.

def vertsForAll(f: VT => Boolean): Boolean

This method should be overridden in final classes.

This method should be overridden in final classes.