# PointF Class

class Qul :: PlatformInterface ::PointF

The PointF class defines a point in the plane using floating point precision. A point is specified by a x coordinate and an y coordinate which can be accessed using the x () 和 y () functions. The coordinates of the point are specified using floating point numbers for accuracy. The isNull () 函数返回 ``` true ``` if both x and y are set to 0.0. The coordinates can be set (or altered) using the setX () 和 setY () functions, or alternatively the rx () 和 ry () functions which return references to the coordinates (allowing direct manipulation). 更多...

 Header: #include Since: Qt Quick Ultralite (Platform) 1.5

This class was introduced in Qt Quick Ultralite (Platform) 1.5.

## 公共函数

 PointF (float xpos , float ypos ) PointF (const Qul::PlatformInterface::Point & point ) PointF () bool isNull () const float manhattanLength () const float & rx () float & ry () void setX (float x ) void setY (float y ) Qul::PlatformInterface::Point toPoint () const float x () const float y () const Qul::PlatformInterface::PointF & operator*= (float factor ) Qul::PlatformInterface::PointF & operator+= (const Qul::PlatformInterface::PointF & point ) Qul::PlatformInterface::PointF & operator-= (const Qul::PlatformInterface::PointF & point ) Qul::PlatformInterface::PointF & operator/= (float divisor )

## 静态公共成员

 float dotProduct (const Qul::PlatformInterface::PointF & p1 , const Qul::PlatformInterface::PointF & p2 )

## 详细描述

A PointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A PointF object can also be divided or multiplied by an ``` coord_t `````` float ``` . In addition, the PointF class provides a constructor converting a Point object into a PointF object, and a corresponding toPoint () function which returns a Point copy of this point. PointF objects can be compared.

## 成员函数文档编制

### ``` [static] ``` float PointF:: dotProduct (const Qul::PlatformInterface::PointF & p1 , const Qul::PlatformInterface::PointF & p2 )

Returns the dot product of p1 and p2 .

### float PointF:: manhattanLength () const

Returns the sum of the absolute values of x () 和 y (), traditionally known as the "Manhattan length" of the vector from the origin to the point.

### float &PointF:: rx ()

Returns a reference to the x coordinate of this point. Using a reference makes it possible to directly manipulate x.

### float &PointF:: ry ()

Returns a reference to the y coordinate of this point. Using a reference makes it possible to directly manipulate y.

### Qul::PlatformInterface::Point PointF:: toPoint () const

Rounds the coordinates of this point to the nearest integer, and returns a Point object with the rounded coordinates.

### Qul::PlatformInterface::PointF &PointF:: operator-= (const Qul::PlatformInterface::PointF & point )

Subtracts the given point from this point and returns a reference to this point.

### Qul::PlatformInterface::PointF &PointF:: operator/= ( float divisor )

Divides both x and y by the given divisor ，并返回此点的引用。