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

PointF 结构

Represents a single-precision floating-point 2D point with geometric operations 表示具有几何运算的单精度浮点二维点

Definition

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

备注

Optimized for graphics programming where high performance with moderate precision is required. Provides all essential vector operations while maintaining memory efficiency.

针对需要中等精度高性能的图形编程而优化, 提供了所有必要的向量运算,同时保持内存效率。

示例

Basic usage:
C#
var pointA = new PointF(1.5f, 2.5f);
var pointB = new PointF(3.0f, 4.0f);
float distance = (float)pointA.DistanceTo(pointB);
PointF sum = pointA + pointB;

构造函数

PointF Represents a single-precision floating-point 2D point with geometric operations 表示具有几何运算的单精度浮点二维点

方法

Add Vector addition (component-wise) 向量加法(分量相加)
CrossProduct(PointF) Calculates cross product with another vector (returns double precision) 计算与另一个向量的叉积(返回双精度)
CrossProduct(PointF, PointF) Calculates 2D cross product magnitude (returns double precision) 计算二维叉积大小(返回双精度)
Distance Calculates Euclidean distance between two points (returns double precision) 计算两点之间的欧几里得距离(返回双精度)
DistanceTo Calculates distance to another point (returns double precision) 计算到另一个点的距离(返回双精度)
DotProduct(PointF) Calculates dot product with another vector (returns double precision) 计算与另一个向量的点积(返回双精度)
DotProduct(PointF, PointF) Calculates dot product of two vectors (returns double precision) 计算两个向量的点积(返回双精度)
Equals Determines if two points are exactly equal 确定两个点是否完全相等
GetTypeGets the Type of the current instance.
(继承自 Object。)
Multiply Scales the point by a double-precision factor (returns float) 使用双精度因子缩放点(返回浮点)
Negate Negates both coordinates (additive inverse) 对两个坐标取反(加法逆元)
Plus Identity operation - returns the point unchanged 恒等运算 - 返回未改变的点
Subtract Vector subtraction (component-wise) 向量减法(分量相减)
ToString Returns a string representation of the point 返回点的字符串表示形式
(重写 ValueTypeToString)

运算符

Addition(PointF, PointF) Vector addition operator 向量加法运算符
Multiply(PointF, Double) Scalar multiplication operator 标量乘法运算符
Subtraction(PointF, PointF) Vector subtraction operator 向量减法运算符
UnaryNegation(PointF) Unary negation operator 一元取反运算符
UnaryPlus(PointF) Unary plus operator - returns the point unchanged 一元加运算符 - 返回未改变的点

字段

X The X-coordinate (single-precision floating-point) X坐标(单精度浮点)
Y The Y-coordinate (single-precision floating-point) Y坐标(单精度浮点)

参见