46 #include <private/qnumeric_p.h> 329 #ifndef QT_NO_DEBUG_STREAM 332 d <<
"QLine(" << p.
p1() <<
',' << p.
p2() <<
')';
337 #ifndef QT_NO_DATASTREAM 352 stream << line.
p1() << line.
p2();
373 line =
QLine(p1, p2);
378 #endif // QT_NO_DATASTREAM 382 return x *
qreal(0.01745329251994329576923690768489);
387 return x *
qreal(57.295779513082320876798154814105);
702 return qSqrt(x*x + y*y);
726 const qreal theta_normalized = theta < 0 ? theta + 360 : theta;
731 return theta_normalized;
777 return QLineF(0, 0,
qCos(angleR) * length, -
qSin(angleR) * length);
796 qWarning(
"QLine::unitVector: New line does not have unit length");
820 const qreal denominator = a.
y() * b.
x() - a.
x() * b.
y();
824 const qreal reciprocal = 1 / denominator;
825 const qreal na = (b.
y() * c.
x() - b.
x() * c.
y()) * reciprocal;
826 if (intersectionPoint)
827 *intersectionPoint = pt1 + a * na;
829 if (na < 0 || na > 1)
832 const qreal nb = (a.
x() * c.
y() - a.
y() * c.
x()) * reciprocal;
833 if (nb < 0 || nb > 1)
959 const qreal delta = a2 - a1;
960 const qreal delta_normalized = delta < 0 ? delta + 360 : delta;
965 return delta_normalized;
1000 if (cos_line >=
qreal(-1.0) && cos_line <=
qreal(1.0)) rad =
qAcos( cos_line );
1005 #ifndef QT_NO_DEBUG_STREAM 1008 d <<
"QLineF(" << p.
p1() <<
',' << p.
p2() <<
')';
1013 #ifndef QT_NO_DATASTREAM 1028 stream << line.
p1() << line.
p2();
1049 line =
QLineF(start, end);
1054 #endif // QT_NO_DATASTREAM The QDebug class provides an output stream for debugging information.
QDataStream & operator>>(QDataStream &stream, QLine &line)
Reads a line from the given stream into the given line and returns a reference to the stream...
#define QT_END_NAMESPACE
This macro expands to.
qreal length() const
Returns the length of the line.
The QLine class provides a two-dimensional vector using integer precision.
QPoint p1() const
Returns the line's start point.
static QLineF fromPolar(qreal length, qreal angle)
Returns a QLineF with the given length and angle.
QPointF p1() const
Returns the line's start point.
QPoint p2() const
Returns the line's end point.
The QPointF class defines a point in the plane using floating point precision.
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const
Returns a value indicating whether or not this line intersects with the given line.
long ASN1_INTEGER_get ASN1_INTEGER * a
qreal dy() const
Returns the vertical component of the line's vector.
QLineF unitVector() const
Returns the unit vector for this line, i.e a line starting at the same point as this line with a leng...
Q_DECL_CONSTEXPR T qAbs(const T &t)
QDataStream & operator>>(QDataStream &stream, QLineF &line)
Reads a line from the given stream into the given line and returns a reference to the stream...
qreal angleTo(const QLineF &l) const
Returns the angle (in positive degrees) from this line to the given line, taking the direction of the...
qreal x() const
Returns the x-coordinate of this point.
The QLineF class provides a two-dimensional vector using floating point precision.
static qreal q_rad2deg(qreal x)
#define QT_BEGIN_NAMESPACE
This macro expands to.
qreal & rx()
Returns a reference to the x coordinate of this point.
QDataStream & operator<<(QDataStream &stream, const QLineF &line)
Writes the given line to the given stream and returns a reference to the stream.
QDataStream & operator<<(QDataStream &stream, const QLine &line)
Writes the given line to the given stream and returns a reference to the stream.
static qreal q_deg2rad(qreal x)
IntersectType
Describes the intersection between two lines.
Q_CORE_EXPORT void qWarning(const char *,...)
qreal angle() const
Returns the angle of the line in degrees.
qreal qAtan2(qreal x, qreal y)
qreal dx() const
Returns the horizontal component of the line's vector.
The QPoint class defines a point in the plane using integer precision.
QPointF p2() const
Returns the line's end point.
qreal & ry()
Returns a reference to the y coordinate of this point.
qreal y() const
Returns the y-coordinate of this point.
The QDataStream class provides serialization of binary data to a QIODevice.
QLineF()
Constructs a null line.
static const KeyPair *const end
QDataStream & operator<<(QDataStream &out, const QUrl &url)
Writes url url to the stream out and returns a reference to the stream.
static bool qt_is_finite(double d)
void setAngle(qreal angle)
Sets the angle of the line to the given angle (in degrees).
bool isNull() const
Returns true if the line is not set up with valid start and end point; otherwise returns false...