Table of contents

Quadrilateral

The Quadrilateral class represents a quadrilateral shape in 2D space. It contains an array of four Point objects, which represent the vertices of the quadrilateral.

Definition

Package: com.dynamsoft.core.basic_structures

class Quadrilateral

Attributes

Attribute Type Description
points Point[] An array of 4 Points that define the quadrilateral.
id int The ID of the quadrilateral.

Constructors

Constructor Description
Quadrilateral() Default constructor. Initializes a new instance of the Quadrilateral class.
Quadrilateral(Quadrilateral quadrilateral) Copy constructor.
Quadrilateral(Point point1, Point point2, Point point3, Point point4) Initializes with four points.
Quadrilateral(Point point1, Point point2, Point point3, Point point4, int id) Initializes with four points and an ID.

Methods

Method Description
contains Determines whether a point is inside the quadrilateral
getArea Gets the area of the quadrilateral.
getBoundingRect Gets the bounding rectangle of the quadrilateral.

Attributes

points

An array of 4 Points that define the quadrilateral.

public Point[] points

id

The ID of the quadrilateral.

public int id

Constructors

Quadrilateral

Default constructor. Initializes a new instance of the Quadrilateral class with default values.

Quadrilateral()

Quadrilateral

Copy constructor. Initializes a new instance by copying another Quadrilateral.

Quadrilateral(Quadrilateral quadrilateral)

Parameters

quadrilateral The Quadrilateral object to copy.

Quadrilateral

Initializes a new instance with four points.

Quadrilateral(Point point1, Point point2, Point point3, Point point4)

Parameters

point1 The first point of the quadrilateral.

point2 The second point of the quadrilateral.

point3 The third point of the quadrilateral.

point4 The fourth point of the quadrilateral.

Quadrilateral

Initializes a new instance with four points and an ID.

Quadrilateral(Point point1, Point point2, Point point3, Point point4, int id)

Parameters

point1 The first point of the quadrilateral.

point2 The second point of the quadrilateral.

point3 The third point of the quadrilateral.

point4 The fourth point of the quadrilateral.

id The ID of the quadrilateral.

Methods

contains

Determines whether a point is inside the quadrilateral.

boolean contains(Point point)

Parameters

point The point to test.

Return Value

Returns true if the point inside the quadrilateral, false otherwise.

See Also

Point

getArea

Gets the area of the quadrilateral.

int getArea()

Return Value

Returns the area of the quadrilateral.

getBoundingRect

Gets the bounding rectangle of the quadrilateral.

Rect getBoundingRect()

Return Value

Returns bounding rectangle of the quadrilateral, in type of Rect.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: