Lines Matching defs:coords

36      * Coordinates or coords arrays store segment coordinates. They use the same format as
128 private static void quadCurveSegment(float[] coords, float t0, float t1) {
132 float mx = mu * mu * coords[0] + 2 * mu * mt * coords[2] + mt * mt * coords[4];
133 float my = mu * mu * coords[1] + 2 * mu * mt * coords[3] + mt * mt * coords[5];
138 // coords at t0
139 coords[0] = coords[0] * u0 * u0 + coords[2] * 2 * t0 * u0 + coords[4] * t0 * t0;
140 coords[1] = coords[1] * u0 * u0 + coords[3] * 2 * t0 * u0 + coords[5] * t0 * t0;
142 // coords at t1
143 coords[4] = coords[0] * u1 * u1 + coords[2] * 2 * t1 * u1 + coords[4] * t1 * t1;
144 coords[5] = coords[1] * u1 * u1 + coords[3] * 2 * t1 * u1 + coords[5] * t1 * t1;
147 coords[2] = 2 * mx - coords[0] / 2 - coords[4] / 2;
148 coords[3] = 2 * my - coords[1] / 2 - coords[5] / 2;
151 private static void cubicCurveSegment(float[] coords, float t0, float t1) {
158 float qxa = coords[0] * u0 * u0 + coords[2] * 2 * t0 * u0 + coords[4] * t0 * t0;
159 float qxb = coords[0] * u1 * u1 + coords[2] * 2 * t1 * u1 + coords[4] * t1 * t1;
160 float qxc = coords[2] * u0 * u0 + coords[4] * 2 * t0 * u0 + coords[6] * t0 * t0;
161 float qxd = coords[2] * u1 * u1 + coords[4] * 2 * t1 * u1 + coords[6] * t1 * t1;
163 float qya = coords[1] * u0 * u0 + coords[3] * 2 * t0 * u0 + coords[5] * t0 * t0;
164 float qyb = coords[1] * u1 * u1 + coords[3] * 2 * t1 * u1 + coords[5] * t1 * t1;
165 float qyc = coords[3] * u0 * u0 + coords[5] * 2 * t0 * u0 + coords[7] * t0 * t0;
166 float qyd = coords[3] * u1 * u1 + coords[5] * 2 * t1 * u1 + coords[7] * t1 * t1;
169 coords[0] = qxa * u0 + qxc * t0;
170 coords[1] = qya * u0 + qyc * t0;
172 coords[2] = qxa * u1 + qxc * t1;
173 coords[3] = qya * u1 + qyc * t1;
175 coords[4] = qxb * u0 + qxd * t0;
176 coords[5] = qyb * u0 + qyd * t0;
178 coords[6] = qxb * u1 + qxd * t1;
179 coords[7] = qyb * u1 + qyd * t1;
186 * @param coords the segment coordinates array
189 private static void getShapeEndPoint(int type, @NonNull float[] coords, @NonNull float[]
193 point[0] = coords[pointIndex];
194 point[1] = coords[pointIndex + 1];
247 private void getPointAtLength(int type, @NonNull float[] coords, float lastX, float
250 point[0] = lastX + (coords[0] - lastX) * t;
251 point[1] = lastY + (coords[1] - lastY) * t;
259 System.arraycopy(coords, 0, curve, 2, coords.length);
378 public int currentSegment(float[] coords) {
379 System.arraycopy(mCurrentCoords, 0, coords, 0, getNumberOfPoints(mCurrentType) * 2);
384 public int currentSegment(double[] coords) {
438 * coords array.
442 public int currentSegment(@NonNull float[] coords, float length) {
443 int type = currentSegment(coords);
452 // We find at which offset the end point is located within the coords array and set
460 System.arraycopy(coords, 0, curve, 2, coords.length);
466 System.arraycopy(curve, 2, coords, 0, coords.length);
470 getPointAtLength(type, coords, mLastPoint[0], mLastPoint[1], t, point);
471 coords[0] = point[0];
472 coords[1] = point[1];