EllipticArcSegment.withCenter constructor

EllipticArcSegment.withCenter({
  1. required ArcGISPoint centerPoint,
  2. required double rotationAngle,
  3. required double semiMajorAxis,
  4. required double minorMajorRatio,
  5. required double startAngle,
  6. required double centralAngle,
  7. SpatialReference? spatialReference,
})

Creates an elliptic arc based on parameters that define an ellipse and the portion of that ellipse that defines the arc.

The spatial reference parameter is used if the center point parameter has a null spatial reference. If both spatial references are supplied, they must be equal.

The z-value and m-value of the center point (if present) are ignored. Use EllipticArcSegment.withStartAndEndpoints to create an EllipticArcSegment with end points with z-value and/or m-value.

Parameters:

  • centerPoint — The center point of the embedded ellipse.
  • rotationAngle — The angle in radians by which the major axis of the embedded ellipse is rotated from the x-axis. A positive value corresponds to a counterclockwise rotation from the x-axis. The value is taken in the form of the modulo of 2 * PI (360 degrees). For example, an input rotation angle of 7.5 radians (430 degrees) would return a segment with a rotation angle of 1.22 radians (70 degrees).
  • semiMajorAxis — The length of the semi-major axis of the embedded ellipse in the units of the spatial reference.
  • minorMajorRatio — The ratio of the length of the semi-minor axis to the length of the semi-major axis of the embedded ellipse.
  • startAngle — The parametric angle in radians of the start of the arc relative to the major axis of the embedded ellipse. A positive value corresponds to a counterclockwise rotation from the major axis. The value is taken in the form of the modulo of 2 * PI (360 degrees). For example, an input rotation angle of 7.5 radians (430 degrees) would return a segment with a rotation angle of 1.22 radians (70 degrees).
  • centralAngle — The parametric angle in radians measuring the span of the arc from EllipticArcSegment.startAngle to EllipticArcSegment.endAngle. A positive value corresponds to a counterclockwise arc sweep. Values larger than 2 * PI (360 degrees) return a segment with a central angle of exactly 2 * PI (360 degrees), resulting in a full ellipse where the start and end points are identical.
  • spatialReference — A spatial reference to use for the segment if the center point parameter does not have a spatial reference set.

Implementation

factory EllipticArcSegment.withCenter({
  required ArcGISPoint centerPoint,
  required double rotationAngle,
  required double semiMajorAxis,
  required double minorMajorRatio,
  required double startAngle,
  required double centralAngle,
  SpatialReference? spatialReference,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_EllipticArcSegment_createWithCenter(
      centerPoint._handle,
      rotationAngle,
      semiMajorAxis,
      minorMajorRatio,
      startAngle,
      centralAngle,
      spatialReference?._handle ?? ffi.nullptr,
      errorHandler,
    );
  });
  final EllipticArcSegment object = EllipticArcSegment._withHandle(handle);
  object._spatialReference.cache(spatialReference);
  return object;
}