public class PEdge extends Object
Note: PEdges PEdge(a, b)
and PEdge(b, a)
are
considered equal.
Modifier and Type | Field and Description |
---|---|
processing.core.PVector |
a |
processing.core.PVector |
b |
Constructor and Description |
---|
PEdge(double x1,
double y1,
double x2,
double y2) |
PEdge(processing.core.PVector a,
processing.core.PVector b) |
Modifier and Type | Method and Description |
---|---|
PEdge |
copy() |
boolean |
equals(Object obj) |
int |
hashCode() |
float |
length()
Calculates the Euclidean distance of this PEdge.
|
processing.core.PVector |
midpoint() |
PEdge |
round()
Rounds (mutates) the vertex coordinates of this PEdge to their closest ints.
|
PEdge |
slice(double from,
double to)
Calculates the subsection of this PEdge as a new PEdge.
|
String |
toString() |
public PEdge(processing.core.PVector a, processing.core.PVector b)
public PEdge(double x1, double y1, double x2, double y2)
public PEdge round()
public processing.core.PVector midpoint()
public float length()
public PEdge slice(double from, double to)
from
- the start of the subsection as a normalized value along the
length of this PEdge. 'from' should be less than or equal to
'to'.to
- the end of the subsection as a normalized value along the length
of this PEdge. 'to' should be greater than or equal to 'from'.a
) and 'to' (towards end b
).public PEdge copy()
Copyright © 2023. All rights reserved.