line2d.html
来自「API資料大全」· HTML 代码 · 共 1,339 行 · 第 1/4 页
HTML
1,339 行
<DL><DD>Sets the location of the endpoints of this <code>Line2D</code> to the specified double coordinates.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>X1, Y1</CODE> - the first specified coordinate<DD><CODE>X2, Y2</CODE> - the second specified coordinate</DL></DD></DL><HR><A NAME="setLine(java.awt.geom.Point2D, java.awt.geom.Point2D)"><!-- --></A><H3>setLine</H3><PRE>public void <B>setLine</B>(<A HREF="../../../java/awt/geom/Point2D.html">Point2D</A> p1, <A HREF="../../../java/awt/geom/Point2D.html">Point2D</A> p2)</PRE><DL><DD>Sets the location of the endpoints of this <code>Line2D</code> to the specified <code>Point2D</code> coordinates.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p1, p2</CODE> - the specified <code>Point2D</code> objects</DL></DD></DL><HR><A NAME="setLine(java.awt.geom.Line2D)"><!-- --></A><H3>setLine</H3><PRE>public void <B>setLine</B>(<A HREF="../../../java/awt/geom/Line2D.html">Line2D</A> l)</PRE><DL><DD>Sets the location of the endpoints of this <code>Line2D</code> to the same as those endpoints of the specified <code>Line2D</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - the specified <code>Line2D</code></DL></DD></DL><HR><A NAME="relativeCCW(double, double, double, double, double, double)"><!-- --></A><H3>relativeCCW</H3><PRE>public static int <B>relativeCCW</B>(double X1, double Y1, double X2, double Y2, double PX, double PY)</PRE><DL><DD>Returns an indicator of where the specified point (PX, PY) lies with respect to the line segment from (X1, Y1) to (X2, Y2). The value is 1 if the line segment must turn counterclockwise to point at the specified point, -1 if it must turn clockwise, or 0 if the point lies exactly on the line segment. If the point is colinear with the line segment, but not between the endpoints, then the value will be -1 if the point lies "beyond (X1, Y1)" or 1 if the point lies "beyond (X2, Y2)". Note that an indicator value of 0 is rare and not useful for determining colinearity because of floating point rounding issues.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>X1, Y1</CODE> - the coordinates of the beginning of the specified line segment<DD><CODE>X2, Y2</CODE> - the coordinates of the end of the specified line segment<DD><CODE>PX, PY</CODE> - the coordinates of the specified point to be compared with the specified line segment<DT><B>Returns:</B><DD>an integer that indicates the position of the third specified coordinates with respect to the line segment formed by the first two specified coordinates.</DL></DD></DL><HR><A NAME="relativeCCW(double, double)"><!-- --></A><H3>relativeCCW</H3><PRE>public int <B>relativeCCW</B>(double PX, double PY)</PRE><DL><DD>Returns an indicator of where the specified point (PX, PY) lies with respect to this line segment. The value is 1 if the line segment must turn counterclockwise to point at the specified point, -1 if it must turn clockwise, or 0 if the point lies exactly on the line segment. If the point is colinear with the line segment, but not between the endpoints, then the value is -1 if the point lies "beyond (x1, y1)" or 1 if the point lies "beyond (x2, y2)". Note that an indicator value of 0 is rare and not useful for determining colinearity because of floating point rounding issues.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>PX, PY</CODE> - the coordinates of the specified point to be compared with the current line segment<DT><B>Returns:</B><DD>an integer that indicates the position of the specified coordinates with respect to the current line segment.</DL></DD></DL><HR><A NAME="relativeCCW(java.awt.geom.Point2D)"><!-- --></A><H3>relativeCCW</H3><PRE>public int <B>relativeCCW</B>(<A HREF="../../../java/awt/geom/Point2D.html">Point2D</A> p)</PRE><DL><DD>Returns an indicator of where the specified <code>Point2D</code> lies with respect to this line segment. The value is 1 if the line segment must turn counterclockwise to point at the specified point, -1 if it must turn clockwise, or 0 if the point lies exactly on the line segment. If the point is colinear with the line segment, but not between the endpoints, then the value is -1 if the point lies "beyond (x1, y1)" or 1 if the point lies "beyond (x2, y2)". Note that an indicator value of 0 is rare and not useful for determining colinearity because of floating point rounding issues.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>p</CODE> - the specified <code>Point2D</code> to be compared with the current line segment<DT><B>Returns:</B><DD>an integer that indicates the position of the <code>Point2D</code> with respect to the current line segment.</DL></DD></DL><HR><A NAME="linesIntersect(double, double, double, double, double, double, double, double)"><!-- --></A><H3>linesIntersect</H3><PRE>public static boolean <B>linesIntersect</B>(double X1, double Y1, double X2, double Y2, double X3, double Y3, double X4, double Y4)</PRE><DL><DD>Tests if the line segment from (X1, Y1) to (X2, Y2) intersects the line segment from (X3, Y3) to (X4, Y4).<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>X1, Y1</CODE> - the coordinates of the beginning of the first specified line segment<DD><CODE>X2, Y2</CODE> - the coordinates of the end of the first specified line segment<DD><CODE>X3, Y3</CODE> - the coordinates of the beginning of the second specified line segment<DD><CODE>X4, Y4</CODE> - the coordinates of the end of the second specified line segment<DT><B>Returns:</B><DD><code>true</code> if the first specified line segment and the second specified line segment intersect each other; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="intersectsLine(double, double, double, double)"><!-- --></A><H3>intersectsLine</H3><PRE>public boolean <B>intersectsLine</B>(double X1, double Y1, double X2, double Y2)</PRE><DL><DD>Tests if the line segment from (X1, Y1) to (X2, Y2) intersects this line segment.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>X1, Y1</CODE> - the coordinates of the beginning of the specified line segment<DD><CODE>X2, Y2</CODE> - the coordinates of the end of the specified line segment<DT><B>Returns:</B><DD><true> if this line segment and the specified line segment intersect each other; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="intersectsLine(java.awt.geom.Line2D)"><!-- --></A><H3>intersectsLine</H3><PRE>public boolean <B>intersectsLine</B>(<A HREF="../../../java/awt/geom/Line2D.html">Line2D</A> l)</PRE><DL><DD>Tests if the specified line segment intersects this line segment.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - the specified <code>Line2D</code><DT><B>Returns:</B><DD><code>true</code> if this line segment and the specified line segment intersect each other; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="ptSegDistSq(double, double, double, double, double, double)"><!-- --></A><H3>ptSegDistSq</H3><PRE>public static double <B>ptSegDistSq</B>(double X1, double Y1, double X2, double Y2, double PX, double PY)</PRE><DL><DD>Returns the square of the distance from a point to a line segment.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>X1, Y1</CODE> - the coordinates of the beginning of the specified line segment<DD><CODE>X2, Y2</CODE> - the coordinates of the end of the specified line segment<DD><CODE>PX, PY</CODE> - the coordinates of the specified point being measured<DT><B>Returns:</B><DD>a double value that is the square of the distance from the specified point to the specified line segment.</DL></DD></DL><HR><A NAME="ptSegDist(double, double, double, double, double, double)"><!-- --></A><H3>ptSegDist</H3><PRE>public static double <B>ptSegDist</B>(double X1, double Y1, double X2, double Y2, double PX, double PY)</PRE><DL><DD>Returns the distance from a point to a line segment.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>X1, Y1</CODE> - the coordinates of the beginning of the specified line segment<DD><CODE>X2, Y2</CODE> - the coordinates of the end of the specified line segment<DD><CODE>PX, PY</CODE> - the coordinates of the specified point being measured<DT><B>Returns:</B><DD>a double value that is the distance from the specified point to the specified line segment.</DL></DD></DL><HR><A NAME="ptSegDistSq(double, double)"><!-- --></A><H3>ptSegDistSq</H3><PRE>public double <B>ptSegDistSq</B>(double PX, double PY)</PRE><DL><DD>Returns the square of the distance from a point to this line segment.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>PX, PY</CODE> - the coordinates of the specified point being measured<DT><B>Returns:</B><DD>a double value that is the square of the distance from a specified point to the current line segment.</DL></DD></DL><HR><A NAME="ptSegDistSq(java.awt.geom.Point2D)"><!-- --></A><H3>ptSegDistSq</H3><PRE>public double <B>ptSegDistSq</B>(<A HREF="../../../java/awt/geom/Point2D.html">Point2D</A> pt)</PRE><DL><DD>Returns the square of the distance from a <code>Point2D</code> to this line segment.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pt</CODE> - the specified <code>Point2D</code> being measured<DT><B>Returns:</B><DD>a double value that is the square of the distance from a specified <code>Point2D</code> to the current line segment.</DL></DD></DL><HR><A NAME="ptSegDist(double, double)"><!-- --></A><H3>ptSegDist</H3><PRE>public double <B>ptSegDist</B>(double PX, double PY)</PRE><DL><DD>Returns the distance from a point to this line segment.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>PX, PY</CODE> - the coordinates of the specified point being measured<DT><B>Returns:</B><DD>a double value that is the distance from a specified point to the current line segment.</DL></DD></DL><HR><A NAME="ptSegDist(java.awt.geom.Point2D)"><!-- --></A><H3>ptSegDist</H3><PRE>public double <B>ptSegDist</B>(<A HREF="../../../java/awt/geom/Point2D.html">Point2D</A> pt)</PRE><DL><DD>Returns the distance from a <code>Point2D</code> to this line segment.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pt</CODE> - the specified <code>Point2D</code> being measured<DT><B>Returns:</B><DD>a double value that is the distance from a specified <code>Point2D</code> to the current line segment.</DL></DD></DL><HR><A NAME="ptLineDistSq(double, double, double, double, double, double)"><!-- --></A><H3>ptLineDistSq</H3><PRE>public static double <B>ptLineDistSq</B>(double X1, double Y1, double X2, double Y2, double PX, double PY)</PRE><DL><DD>Returns the square of the distance from a point to a line.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>X1, Y1</CODE> - the coordinates of the beginning of the specified line segment<DD><CODE>X2, Y2</CODE> - the coordinates of the end of the specified line segment<DD><CODE>PX, PY</CODE> - the coordinates of the specified point being measured<DT><B>Returns:</B><DD>a double value that is the square of the distance from a specified point to a specified line segment.</DL></DD></DL>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?