Remarks: The point struct is used for drawing and positioning of elements and widgets
Constructors
PointF
#Initializes a new instance of a PointF class with values of the Point
pointParameters:
| point (Point) | Point to initialize the X and Y values of the new instance with |
PointF
#Initializes a new instance of a Point class with X and Y values corresponding to the Size.Width and Size.Height values of the specified
size, respecitivelyParameters:
| size (SizeF) | Size to initialize the X and Y values of the new instance with |
Fields
Properties
Angle
#Gets the angle of the point as a vector from origin 0,0.
Value: The angle of this point as a vector.
Length
#Gets the length of the point as a vector from origin 0,0
Value: The length of this point as a vector
LengthSquared
#Gets the squared length of the point as a vector from origin 0,0.
Value: The length of the squared.
Normal
#Gets the point as a normal vector (perpendicular) to the current point from the origin
Value: The normal vector of this point
UnitVector
#Gets the current point as a unit vector (a point with a Length of 1.0 from origin 0,0)
Value: The unit vector equivalent of this point's X and Y coordinates
Methods
Abs
#Returns the absolute X and Y components of the specified
pointParameters:
| point (PointF) | Point with positive or negative X and/or Y values |
Returns: A new point with absolute (positive) X and Y values of the specified
pointAngleTo
#Gets the angle of the width/height as a vector from the specified
destination.Value: The angle in degrees between this point and
destinationParameters:
| destination (PointF) | Destination point to determine the angle |
Distance
#Gets the distance between this point and the specified
pointParameters:
| point (PointF) | Point to calculate the distance from |
Distance
#Gets the distance between two points using pythagoras theorem
DotProduct
#Gets the dot product of this instance and the specified
pointParameters:
| point (PointF) | Point to get the dot product for |
Returns: The dot product (X * point.X + Y * point.Y) between this point and the specified point
DotProduct
#Gets the dot product between two points
Equals
#Returns a value indicating that the specified
obj is equal to this pointParameters:
| obj (object) | Object to compare |
Returns: True if the specified
obj is a Point and is equal to this instance, false otherwiseOverrides: ValueType.Equals
Equals
#Returns a value indicating that the specified
other point is equal to this pointParameters:
| other (PointF) | Other point to compare |
Returns: True if the other point is equal to this point, otherwise false
GetHashCode
#Gets the hash code of this point
Returns: Hash code for this point
Overrides: ValueType.GetHashCode
LengthTo
#Gets the length between this point and the
destination point.Parameters:
| destination (PointF) | Point to determine the length to. |
Returns: The length between this instance and the
destination .Max
#Returns the maximum X and Y components of two points
Returns: A new point with the maximum X and Y values of the two points
Min
#Returns the minimum X and Y components of two points
Returns: A new point with the minimum X and Y values of the two points
Offset
#Offsets the X and Y co-ordinates of the
point by the specified x and y valuesOffset
#Offsets the X and Y co-ordinates of the
point by the values from the specified offsetOffset
#Offsets the X and Y co-ordinates of this point by the specified
x and y valuesOffset
#Offsets the X and Y co-ordinates of this point by the values from the specified
offsetParameters:
| offset (PointF) | Point with X and Y values to add to this point |
Restrict
#Restricts the X and Y co-ordinates of the specified
point within the rectangleRestrict
#Restricts the X and Y co-ordinates within the specified
rectangleRemarks: This will update the X and Y co-ordinates to be within the specified
rectangle's bounds. The updated co-ordinates will be the closest to the original value as possible. E.g. if the X co-ordinate is greater than the Rectangle.Right of the rectangle, it will be set to be Rectangle.Right minus one, to be within the rectangle's bounds.Parameters:
| rectangle (RectangleF) | Rectangle to restrict the X and Y co-ordinates in |
Rotate
#Treats the
point as a vector and rotates it around the origin (0,0) by the specified angle.Rotate
#Treats the point as a vector and rotates it around the origin (0,0) by the specified
angle.Parameters:
| angle (float) | Angle in degrees to rotate this point around the origin (0,0) |
ToString
#Converts this point to a string
Returns: String representation of this point
Overrides: ValueType.ToString
Operators
| Operation | Result | Description | ||
|---|---|---|---|---|
| PointF | + | float | PointF | Operator to add a value to both the X and Y co-ordinates of a point |
| PointF | + | SizeF | PointF | Operator to add a size to a point |
| PointF | + | PointF | PointF | Operator to return the addition of two points as a PointF |
| PointF | / | float | PointF | Divides the X and Y co-ordinates of the specified point with a given value |
| PointF | / | SizeF | PointF | Divides the specified point with a size |
| PointF | == | PointF | bool | Determines equality between two points |
| PointF | != | PointF | bool | Determines the inequality between two points |
| float | * | PointF | PointF | Multiplies the X and Y co-ordinates of the specified point with a given factor |
| PointF | * | float | PointF | Multiplies the X and Y co-ordinates of the specified point with a given factor |
| PointF | * | SizeF | PointF | Multiplies the specified point with a size |
| PointF | * | PointF | PointF | Multiplies the X and Y co-ordinates of the two specified point values |
| PointF | - | float | PointF | Operator to subtract a value from both the X and Y co-ordinates of a point |
| PointF | - | SizeF | PointF | Operator to subtract a size from a point |
| PointF | - | PointF | PointF | Operator to return the difference between two points as a PointF |
| - | PointF | PointF | Returns a new PointF with negative x and y values of the specified point | |