Show / Hide Table of Contents

Struct ModOp2D

A 2-dimensional modification operation implemented as a homogenous matix 3*2. You can apply such modificaion to GeoVector2D and GeoPoint2D points or to ICurve2D implementing objects.

Implements
System.Runtime.Serialization.ISerializable
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
public struct ModOp2D : ISerializable

Constructors

| Improve this Doc View Source

ModOp2D(Double, Double, Double, Double, Double, Double)

Creates a modification according to the given coefficients

Declaration
public ModOp2D(double Matrix00, double Matrix01, double Matrix02, double Matrix10, double Matrix11, double Matrix12)
Parameters
Type Name Description
System.Double Matrix00
System.Double Matrix01
System.Double Matrix02
System.Double Matrix10
System.Double Matrix11
System.Double Matrix12
| Improve this Doc View Source

ModOp2D(Double[,])

Declaration
public ModOp2D(double[, ] m)
Parameters
Type Name Description
System.Double[,] m

Properties

| Improve this Doc View Source

Determinant

Gets the determinant of this modification

Declaration
public double Determinant { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Factor

Returns the scaling factor of this modification

Declaration
public double Factor { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Identity

Creates a modification which is the identity

Declaration
public static ModOp2D Identity { get; }
Property Value
Type Description
ModOp2D
| Improve this Doc View Source

IsIdentity

Returns true, if this modification is the identity.

Declaration
public bool IsIdentity { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsIsogonal

Declaration
public bool IsIsogonal { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsNull

Declaration
public bool IsNull { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Item[Int32, Int32]

Declaration
public double this[int i, int j] { get; set; }
Parameters
Type Name Description
System.Int32 i
System.Int32 j
Property Value
Type Description
System.Double
| Improve this Doc View Source

Matrix

Gets or sets the 3*2 Matrix that defines this mmodification

Declaration
public double[, ] Matrix { get; set; }
Property Value
Type Description
System.Double[,]
| Improve this Doc View Source

Matrix2D

Declaration
public Matrix Matrix2D { get; }
Property Value
Type Description
System.Drawing.Drawing2D.Matrix

Returns the System.Drawing.Drawing2D.Matrix object equivalent to this modification.

| Improve this Doc View Source

Null

Creates a modification which is null, i.e. no valid ModOp2D

Declaration
public static ModOp2D Null { get; }
Property Value
Type Description
ModOp2D

Methods

| Improve this Doc View Source

Fit(GeoPoint2D[], GeoPoint2D[], Boolean)

Constructs a modification, that transforms the Src points to the Dst points. The length of Src and Dst must be equal and less than 4. If the length is 1, the resulting ModOp is a translation, if the length is 2, the parameter DoScale decides whether the resulting ModOp is a translation and rotation (DoScale==false) or translation, rotation and scaling (DoScale==true). If the length is 3, the resulting modification is any kind of an affinity, that projects the src points to the dst points.

Declaration
public static ModOp2D Fit(GeoPoint2D[] Src, GeoPoint2D[] Dst, bool DoScale)
Parameters
Type Name Description
GeoPoint2D[] Src

source points

GeoPoint2D[] Dst

destination points

System.Boolean DoScale

scaling if two point pairs are given

Returns
Type Description
ModOp2D

resulting transformation

| Improve this Doc View Source

Fit(GeoVector2D[], GeoVector2D[])

Constructs a modification, that transforms the src vectors to the dst vectors. The length of src and dst must be 2. The resulting modification is any kind of an affinity, that projects the src vectors to the dst vectors. The origin (0,0) remains fixed.

Declaration
public static ModOp2D Fit(GeoVector2D[] src, GeoVector2D[] dst)
Parameters
Type Name Description
GeoVector2D[] src

source vectors

GeoVector2D[] dst

destination vectors

Returns
Type Description
ModOp2D

resulting transformation

| Improve this Doc View Source

GetInverse()

Returns the inverse of this modification.

Declaration
public ModOp2D GetInverse()
Returns
Type Description
ModOp2D

inverse

| Improve this Doc View Source

IsAlmostIdentity(Double)

Declaration
public bool IsAlmostIdentity(double precision)
Parameters
Type Name Description
System.Double precision
Returns
Type Description
System.Boolean
| Improve this Doc View Source

PlaneToplane(Plane, Plane)

Returns a 2d modification, that transforms from the coordinate system of the first plane to the coordinate system of the second plane. If the planes ar not coincident, the first plane is projected onto the second plane.

Declaration
public static ModOp2D PlaneToplane(Plane FromPlane, Plane ToPlane)
Parameters
Type Name Description
Plane FromPlane

Source plane

Plane ToPlane

Destination plane

Returns
Type Description
ModOp2D

See above

| Improve this Doc View Source

Rotate(GeoPoint2D, SweepAngle)

Creates a rotation about a fixpoint

Declaration
public static ModOp2D Rotate(GeoPoint2D Center, SweepAngle Rotation)
Parameters
Type Name Description
GeoPoint2D Center

the fixpoint

SweepAngle Rotation

the rotation angle

Returns
Type Description
ModOp2D

resulting modification

| Improve this Doc View Source

Rotate(SweepAngle)

Creates a rotation about the origin

Declaration
public static ModOp2D Rotate(SweepAngle Rotation)
Parameters
Type Name Description
SweepAngle Rotation

the rotation angle

Returns
Type Description
ModOp2D

resulting modification

| Improve this Doc View Source

Scale(GeoPoint2D, Double)

Declaration
public static ModOp2D Scale(GeoPoint2D center, double factor)
Parameters
Type Name Description
GeoPoint2D center
System.Double factor
Returns
Type Description
ModOp2D
| Improve this Doc View Source

Scale(GeoPoint2D, Double, Double)

Declaration
public static ModOp2D Scale(GeoPoint2D center, double factorx, double factory)
Parameters
Type Name Description
GeoPoint2D center
System.Double factorx
System.Double factory
Returns
Type Description
ModOp2D
| Improve this Doc View Source

Scale(Double)

Declaration
public static ModOp2D Scale(double factor)
Parameters
Type Name Description
System.Double factor
Returns
Type Description
ModOp2D
| Improve this Doc View Source

Scale(Double, Double)

Declaration
public static ModOp2D Scale(double factorx, double factory)
Parameters
Type Name Description
System.Double factorx
System.Double factory
Returns
Type Description
ModOp2D
| Improve this Doc View Source

To3D()

Declaration
public ModOp To3D()
Returns
Type Description
ModOp
| Improve this Doc View Source

Translate(GeoVector2D)

Creates a translation

Declaration
public static ModOp2D Translate(GeoVector2D offset)
Parameters
Type Name Description
GeoVector2D offset

offset vector

Returns
Type Description
ModOp2D

resulting modification

| Improve this Doc View Source

Translate(Double, Double)

Creates a translation

Declaration
public static ModOp2D Translate(double dx, double dy)
Parameters
Type Name Description
System.Double dx

x-offset

System.Double dy

y-offset

Returns
Type Description
ModOp2D

resulting modification

| Improve this Doc View Source

XYPart(ModOp)

Returns a 2d ModOp which represents the 2d part of a 3d ModOp.

Declaration
public static ModOp2D XYPart(ModOp m)
Parameters
Type Name Description
ModOp m

3d ModOp

Returns
Type Description
ModOp2D

2d ModOp

Operators

| Improve this Doc View Source

Multiply(ModOp2D, GeoPoint2D)

Modifies the given point by this modification.

Declaration
public static GeoPoint2D operator *(ModOp2D m, GeoPoint2D p)
Parameters
Type Name Description
ModOp2D m

modification

GeoPoint2D p

point

Returns
Type Description
GeoPoint2D

modified point

| Improve this Doc View Source

Multiply(ModOp2D, GeoVector2D)

Modifies the given vector by this modification

Declaration
public static GeoVector2D operator *(ModOp2D m, GeoVector2D v)
Parameters
Type Name Description
ModOp2D m

modification

GeoVector2D v

vector

Returns
Type Description
GeoVector2D

modified vector

| Improve this Doc View Source

Multiply(ModOp2D, ModOp2D)

Combines two modification into one modification. If two modifications have to be applied to several GeoPoint2Ds or GeoVector2Ds it is faster to use the combination.

Declaration
public static ModOp2D operator *(ModOp2D lhs, ModOp2D rhs)
Parameters
Type Name Description
ModOp2D lhs

second modification

ModOp2D rhs

first modification

Returns
Type Description
ModOp2D

the combination

| Improve this Doc View Source

Multiply(ModOp2D, Double)

Multiplies the double value by the scaling factor of this modification

Declaration
public static double operator *(ModOp2D m, double d)
Parameters
Type Name Description
ModOp2D m

modification

System.Double d

input value

Returns
Type Description
System.Double

modified value

Explicit Interface Implementations

| Improve this Doc View Source

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info
System.Runtime.Serialization.StreamingContext context

Implements

System.Runtime.Serialization.ISerializable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX