Lines Matching refs:points

141             float[] strokepoints = stroke.points;
262 * points.
265 * @param numPoints the number of points
266 * @return the sampled points in the form of [x1, y1, x2, y2, ..., xn, yn]
273 float[] pts = stroke.points;
325 * Calculates the centroid of a set of points.
327 * @param points the points in the form of [x1, y1, x2, y2, ..., xn, yn]
330 static float[] computeCentroid(float[] points) {
333 int count = points.length;
335 centerX += points[i];
337 centerY += points[i];
347 * Calculates the variance-covariance matrix of a set of points.
349 * @param points the points in the form of [x1, y1, x2, y2, ..., xn, yn]
352 private static float[][] computeCoVariance(float[] points) {
358 int count = points.length;
360 float x = points[i];
362 float y = points[i];
376 static float computeTotalLength(float[] points) {
378 int count = points.length - 4;
380 float dx = points[i + 2] - points[i];
381 float dy = points[i + 3] - points[i + 1];
387 static float computeStraightness(float[] points) {
388 float totalLen = computeTotalLength(points);
389 float dx = points[2] - points[0];
390 float dy = points[3] - points[1];
394 static float computeStraightness(float[] points, float totalLen) {
395 float dx = points[2] - points[0];
396 float dy = points[3] - points[1];
465 * Computes an oriented, minimum bounding box of a set of points.
472 float[] points = new float[count * 2];
476 points[index] = point.x;
477 points[index + 1] = point.y;
479 float[] meanVector = computeCentroid(points);
480 return computeOrientedBoundingBox(points, meanVector);
484 * Computes an oriented, minimum bounding box of a set of points.
491 float[] points = new float[size];
493 points[i] = originalPoints[i];
495 float[] meanVector = computeCentroid(points);
496 return computeOrientedBoundingBox(points, meanVector);
499 private static OrientedBoundingBox computeOrientedBoundingBox(float[] points, float[] centroid) {
500 translate(points, -centroid[0], -centroid[1]);
502 float[][] array = computeCoVariance(points);
510 rotate(points, -angle);
517 int count = points.length;
519 if (points[i] < minx) {
520 minx = points[i];
522 if (points[i] > maxx) {
523 maxx = points[i];
526 if (points[i] < miny) {
527 miny = points[i];
529 if (points[i] > maxy) {
530 maxy = points[i];
563 static float[] rotate(float[] points, float angle) {
566 int size = points.length;
568 float x = points[i] * cos - points[i + 1] * sin;
569 float y = points[i] * sin + points[i + 1] * cos;
570 points[i] = x;
571 points[i + 1] = y;
573 return points;
576 static float[] translate(float[] points, float dx, float dy) {
577 int size = points.length;
579 points[i] += dx;
580 points[i + 1] += dy;
582 return points;
585 static float[] scale(float[] points, float sx, float sy) {
586 int size = points.length;
588 points[i] *= sx;
589 points[i + 1] *= sy;
591 return points;