Lines Matching refs:p2

1316 TkGetMiterPoints(p1, p2, p3, width, m1, m2)
1319 double p2[]; /* Points to x- and y-coordinates of vertex
1325 * point (see as you face from p1 to p2). */
1329 double theta1; /* Angle of segment p2-p1. */
1330 double theta2; /* Angle of segment p2-p3. */
1335 double dist; /* Distance of miter points from p2. */
1341 if (p2[1] == p1[1]) {
1342 theta1 = (p2[0] < p1[0]) ? 0 : PI;
1343 } else if (p2[0] == p1[0]) {
1344 theta1 = (p2[1] < p1[1]) ? PI/2.0 : -PI/2.0;
1346 theta1 = atan2(p1[1] - p2[1], p1[0] - p2[0]);
1348 if (p3[1] == p2[1]) {
1349 theta2 = (p3[0] > p2[0]) ? 0 : PI;
1350 } else if (p3[0] == p2[0]) {
1351 theta2 = (p3[1] > p2[1]) ? PI/2.0 : -PI/2.0;
1353 theta2 = atan2(p3[1] - p2[1], p3[0] - p2[0]);
1371 * looking from p1 to p2).
1379 m1[0] = p2[0] + deltaX;
1380 m2[0] = p2[0] - deltaX;
1382 m1[1] = p2[1] + deltaY;
1383 m2[1] = p2[1] - deltaY;
1403 * p1 *---------------* p2
1407 * M1 and m2 will be W units apart, with p2 centered between
1408 * them and m1-m2 perpendicular to p1-p2. However, if
1412 * p2 |
1417 * In this case p2 will be width/2 units from the segment m1-m2.
1426 TkGetButtPoints(p1, p2, width, project, m1, m2)
1429 double p2[]; /* Points to x- and y-coordinates of vertex
1432 int project; /* Non-zero means project p2 by an additional
1435 * point, as you face from p1 to p2. */
1439 double length; /* Length of p1-p2 segment. */
1443 length = hypot(p2[0] - p1[0], p2[1] - p1[1]);
1445 m1[0] = m2[0] = p2[0];
1446 m1[1] = m2[1] = p2[1];
1448 deltaX = -width * (p2[1] - p1[1]) / length;
1449 deltaY = width * (p2[0] - p1[0]) / length;
1450 m1[0] = p2[0] + deltaX;
1451 m2[0] = p2[0] - deltaX;
1452 m1[1] = p2[1] + deltaY;
1453 m2[1] = p2[1] - deltaY;