Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

Point 结构

Represents a 2D point with integer coordinates and geometric operations 表示具有整数坐标和几何运算的二维点

Definition

命名空间: DeploySharp.Data
程序集: DeploySharp (在 DeploySharp.dll 中) 版本:0.0.4+6e8a2e904469617cd59619d666c0e272985c0e33
C#
public struct Point : IEquatable<Point>
Inheritance
Object    ValueType    Point
Implements
IEquatablePoint

备注

Provides common geometric operations like distance calculation, vector products, and basic arithmetic operations optimized for performance.

提供常见的几何运算,如距离计算、向量积和为性能优化的基本算术运算。

构造函数

Point(Double, Double) Initializes a new point from double values (truncates to integers) 从双精度值初始化新点(截断为整数)
Point(Int32, Int32) Represents a 2D point with integer coordinates and geometric operations 表示具有整数坐标和几何运算的二维点

方法

Add Adds two points component-wise 分量相加两个点
CrossProduct(Point) Calculates cross product with another point (vector) 计算与另一点(向量)的叉积
CrossProduct(Point, Point) Calculates cross product between two points (vectors) 计算两点(向量)之间的叉积
Distance Calculates Euclidean distance between two points 计算两点之间的欧几里得距离
DistanceTo Calculates Euclidean distance to another point 计算到另一点的欧几里得距离
DotProduct(Point) Calculates dot product with another point (vector) 计算与另一点(向量)的点积
DotProduct(Point, Point) Calculates dot product between two points (vectors) 计算两点(向量)之间的点积
Equals Compares two points for equality 比较两点是否相等
GetTypeGets the Type of the current instance.
(继承自 Object。)
Multiply Multiplies both coordinates by a scalar value 将两个坐标乘以标量值
Negate Negates both coordinates of the point 取反点的两个坐标
Plus Returns the point unchanged (identity operation) 返回未更改的点(恒等运算)
Subtract Subtracts one point from another component-wise 分量相减两个点
ToString Returns string representation of the point 返回点的字符串表示形式
(重写 ValueTypeToString)

运算符

Addition(Point, Point) Adds two points component-wise 分量相加两个点
Multiply(Point, Double) Multiplies both coordinates by a scalar value 将两个坐标乘以标量值
Subtraction(Point, Point) Subtracts one point from another component-wise 分量相减两个点
UnaryNegation(Point) Negates both coordinates of the point 取反点的两个坐标
UnaryPlus(Point) Returns the point unchanged (identity operation) 返回未更改的点(恒等运算)

字段

X The X-coordinate of the point 点的X坐标
Y The Y-coordinate of the point 点的Y坐标

参见