Circle
Circle Geometric Object
Circle
Bases: Ellipse
Circle geometrical object
Source code in otary/geometry/continuous/shape/circle.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
|
centroid
property
Center of the circle
Returns:
Name | Type | Description |
---|---|---|
float |
NDArray
|
center 2D point |
is_circle
property
Check if the circle is a circle
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if circle else False |
perimeter
property
Perimeter of the circle
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
perimeter value |
shapely_edges
property
Returns the Shapely.LinearRing as a curve representation of the Circle. See https://shapely.readthedocs.io/en/stable/reference/shapely.LinearRing.html
Returns:
Name | Type | Description |
---|---|---|
LinearRing |
LinearRing
|
shapely.LinearRing object |
shapely_surface
property
Returns the Shapely.Polygon as an surface representation of the Circle. See https://shapely.readthedocs.io/en/stable/reference/shapely.Polygon.html
Returns:
Name | Type | Description |
---|---|---|
Polygon |
Polygon
|
shapely.Polygon object |
xmax
property
Get the maximum X coordinate of the geometry entity
Returns:
Name | Type | Description |
---|---|---|
NDArray |
float
|
2D point |
xmin
property
Get the minimum X coordinate of the geometry entity
Returns:
Name | Type | Description |
---|---|---|
NDArray |
float
|
2D point |
ymax
property
Get the maximum Y coordinate of the geometry entity
Returns:
Name | Type | Description |
---|---|---|
NDArray |
float
|
2D point |
ymin
property
Get the minimum Y coordinate of the geometry entity
Returns:
Name | Type | Description |
---|---|---|
NDArray |
float
|
2D point |
__init__(center, radius, n_points_polygonal_approx=ContinuousGeometryEntity.DEFAULT_N_POLY_APPROX)
Initialize a Circle geometrical object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
center
|
NDArray
|
center 2D point |
required |
radius
|
float
|
radius value |
required |
n_points_polygonal_approx
|
int
|
number of points to be used in the polygonal approximation of the circle. Defaults to ContinuousGeometryEntity.DEFAULT_N_POINTS_POLYGONAL_APPROX. |
DEFAULT_N_POLY_APPROX
|
Source code in otary/geometry/continuous/shape/circle.py
copy()
Copy the circle object
Returns:
Name | Type | Description |
---|---|---|
Self |
Self
|
copied circle object |
Source code in otary/geometry/continuous/shape/circle.py
curvature(point=None)
Curvature of circle is a constant and does not depend on a position of a point
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
curvature value |
normalize(x, y)
Normalize the circle by dividing the points by a norm on the x and y coordinates. This does not change the circle radius.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
x coordinate norm |
required |
y
|
float
|
y coordinate norm |
required |
Returns:
Name | Type | Description |
---|---|---|
Self |
Self
|
normalized circle object |
Source code in otary/geometry/continuous/shape/circle.py
polygonal_approx(n_points, is_cast_int=False)
Generate a Polygon object that is an approximation of the circle as a discrete geometrical object made up of only points and segments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_points
|
int
|
number of points that make up the circle polygonal approximation |
required |
is_cast_int
|
bool
|
whether to cast to int the points coordinates or not. Defaults to False |
False
|
Returns:
Name | Type | Description |
---|---|---|
Polygon |
Polygon
|
Polygon representing the circle as a succession of n points |
Source code in otary/geometry/continuous/shape/circle.py
rotate(angle, is_degree=False, is_clockwise=True, pivot=None)
Rotate the circle around a pivot point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
angle
|
float
|
angle by which to rotate the circle |
required |
is_degree
|
bool
|
whether the angle is in degrees. Defaults to False. |
False
|
is_clockwise
|
bool
|
whether the rotation is clockwise. Defaults to True. |
True
|
pivot
|
Optional[NDArray]
|
pivot point around which to rotate. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Self |
Self
|
rotated circle object |
Source code in otary/geometry/continuous/shape/circle.py
shift(vector)
Shift the circle by a given vector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vector
|
NDArray
|
2D vector by which to shift the circle |
required |
Returns:
Name | Type | Description |
---|---|---|
Self |
Self
|
shifted circle object |