Method calculates coordinates from a given grid point.
183105
public Point3d getCoordinatesFromGridPoint(Point3d gridPoint) {
        double dx = minx + latticeConstant * gridPoint.x;
        double dy = miny + latticeConstant * gridPoint.y;
        double dz = minz + latticeConstant * gridPoint.z;
        return new Point3d(dx, dy, dz);
    }
1217215
@Override
	@Pure
	protected Rectangle2d calcBounds() {
		final GeoLocationPoint p = getGeoPosition();
		if (p == null) {
			return null;
		}
		return new Rectangle2d(p.getX(), p.getY(), 0, 0);
	}
1338798
def convert_coord_object(coord):
    """"""
    assert isinstance(coord, Coordinate)
    coord = coord.container()
    return Tile(int(coord.zoom), int(coord.column), int(coord.row))
507274
def interpolate_grid(self, in_lon, in_lat):
        
        out_data = np.zeros((self.data.shape[0], in_lon.shape[0], in_lon.shape[1]))
        for d in range(self.data.shape[0]):
            print("Loading ", d, self.variable, self.start_date)
            if self.data[d].max() > -999:
                step = self.data[d]
                step[step < 0] = 0
                if self.lat[-1] < self.lat[0]:
                    spline = RectBivariateSpline(self.lat[::-1], self.lon, step[::-1], kx=3, ky=3)
                else:
                    spline = RectBivariateSpline(self.lat, self.lon, step, kx=3, ky=3)
                print("Evaluating", d, self.variable, self.start_date)
                flat_data = spline.ev(in_lat.ravel(), in_lon.ravel())
                out_data[d] = flat_data.reshape(in_lon.shape)
                del spline
            else:
                print(d, " is missing")
                out_data[d] = -9999
        return out_data
168165
function(points, callback, fromIndex, toIndex) {
	var newPoints = [], i, len;
	try {
		for (i = 0, len = points.length; i < len; i++) {
			if (!points[i].lat || !points[i].lng) {
				continue;
			}
			newPoints.push(points[i]);
		}
		calculateFromGPX(newPoints, callback, fromIndex, toIndex);
	} catch(e) {
		callback(e, null);
	}
}
424895
def set_coordinates(self, x, y, z=None):
        """"""
        self.x = x
        self.y = y
        self.z = z
471114
public Point2D.Double calc(double t, Point2D.Double... controlPoints)
    {
        if (controlPoints.length != length)
        {
            throw new IllegalArgumentException("control-points length not "+length);
        }
        double[] cp = convert(controlPoints);
        Point2D.Double point = new Point2D.Double();
        calc(t, point::setLocation, cp);
        return point;
    }
171031
public Triangle findCellTriangleOf(Point3D point) {
        int x_index = (int) ((point.x - indexRegion.minX()) / x_size);
        int y_index = (int) ((point.y - indexRegion.minY()) / y_size);
        return grid[x_index][y_index];
    }
111761
protected void calculatePointerAngle() {
        float progressPercent = ((float) mProgress / (float) mMax);
        mPointerPosition = (progressPercent * mTotalCircleDegrees) + mStartAngle;
        mPointerPosition = mPointerPosition % 360f;
    }
279208
def point(self, x, y):
        """"""
        shapeType = POINT
        pointShape = Shape(shapeType)
        pointShape.points.append([x, y])
        self.shape(pointShape)
1223871
def _populate_coordinates(self):
        """"""
        rect = self.tool.rectangle()
        self.blockSignals(True)
        if not rect.isEmpty():
            self.x_minimum.setValue(rect.xMinimum())
            self.y_minimum.setValue(rect.yMinimum())
            self.x_maximum.setValue(rect.xMaximum())
            self.y_maximum.setValue(rect.yMaximum())
        else:
            self.x_minimum.clear()
            self.y_minimum.clear()
            self.x_maximum.clear()
            self.y_maximum.clear()
        self.blockSignals(False)
794759
private List<Coordinate> getCoordinates(List<Geometry> geometries) {
		List<Coordinate> coordinates = new ArrayList<Coordinate>();
		for (Geometry geometry : geometries) {
			Coordinate[] geometryCoordinates = geometry.getCoordinates();
			for (int i = 0; i < geometryCoordinates.length; i++) {
				coordinates.add(geometryCoordinates[i]);
			}
		}
		return coordinates;
	}
1018576
function (x, y, points) {
            this.pos.set(x, y);

            if (!Array.isArray(points)) {
                return this;
            }

            // convert given points to me.Vector2d if required
            if (!(points[0] instanceof me.Vector2d)) {
                var _points = this.points = [];
                points.forEach(function (point) {
                   _points.push(new me.Vector2d(point.x, point.y));
                });
            } else {
                // array of me.Vector2d
                this.points = points;
            }

            this.recalc();
            this.updateBounds();

            return this;
        }
190706
def coordinate(i, j)
      x = @pos.x + (i * @delta_col * @cosines[0]) + (j * @delta_row * @cosines[3])
      y = @pos.y + (i * @delta_col * @cosines[1]) + (j * @delta_row * @cosines[4])
      z = @pos.z + (i * @delta_col * @cosines[2]) + (j * @delta_row * @cosines[5])
      Coordinate.new(x, y, z)
    end
582910
public Point3d getGridPointFrom3dCoordinates(Point3d coord) throws Exception {
        Point3d gridPoint = new Point3d();

        if (coord.x >= minx & coord.x <= maxx) {
            gridPoint.x = (int) Math.round(Math.abs(minx - coord.x) / latticeConstant);
        } else {
            throw new Exception("CDKGridError: Given coordinates are not in grid");
        }
        if (coord.y >= miny & coord.y <= maxy) {
            gridPoint.y = (int) Math.round(Math.abs(miny - coord.y) / latticeConstant);
        } else {
            throw new Exception("CDKGridError: Given coordinates are not in grid");
        }
        if (coord.z >= minz & coord.z <= maxz) {
            gridPoint.z = (int) Math.round(Math.abs(minz - coord.z) / latticeConstant);
        } else {
            throw new Exception("CDKGridError: Given coordinates are not in grid");
        }

        return gridPoint;
    }
1191972
private void calculateGridSizes(float numbersRadius, float xCenter, float yCenter,
            float textSize, float[] textGridHeights, float[] textGridWidths) {
        /*
         * The numbers need to be drawn in a 7x7 grid, representing the points on the Unit Circle.
         */
        float offset1 = numbersRadius;
        // cos(30) = a / r => r * cos(30) = a => r * √3/2 = a
        float offset2 = numbersRadius * ((float) Math.sqrt(3)) / 2f;
        // sin(30) = o / r => r * sin(30) = o => r / 2 = a
        float offset3 = numbersRadius / 2f;
        mPaint.setTextSize(textSize);
        mSelectedPaint.setTextSize(textSize);
        mInactivePaint.setTextSize(textSize);
        // We'll need yTextBase to be slightly lower to account for the text's baseline.
        yCenter -= (mPaint.descent() + mPaint.ascent()) / 2;

        textGridHeights[0] = yCenter - offset1;
        textGridWidths[0] = xCenter - offset1;
        textGridHeights[1] = yCenter - offset2;
        textGridWidths[1] = xCenter - offset2;
        textGridHeights[2] = yCenter - offset3;
        textGridWidths[2] = xCenter - offset3;
        textGridHeights[3] = yCenter;
        textGridWidths[3] = xCenter;
        textGridHeights[4] = yCenter + offset3;
        textGridWidths[4] = xCenter + offset3;
        textGridHeights[5] = yCenter + offset2;
        textGridWidths[5] = xCenter + offset2;
        textGridHeights[6] = yCenter + offset1;
        textGridWidths[6] = xCenter + offset1;
    }
998752
function pixelToTileCoords(x, y, v) {
         var q, r;
         var ret = v || new me.Vector2d();

         if (this.staggeraxis === "x") {
           //flat top
           x = x - (this.staggerindex === "odd" ? this.sideoffsetx : this.tilewidth);
         } else {
           //pointy top
           y = y - (this.staggerindex === "odd" ? this.sideoffsety : this.tileheight);
         } // Start with the coordinates of a grid-aligned tile


         var referencePoint = me.pool.pull("me.Vector2d", Math.floor(x / (this.columnwidth * 2)), Math.floor(y / (this.rowheight * 2))); // Relative x and y position on the base square of the grid-aligned tile

         var rel = me.pool.pull("me.Vector2d", x - referencePoint.x * (this.columnwidth * 2), y - referencePoint.y * (this.rowheight * 2)); // Adjust the reference point to the correct tile coordinates

         if (this.staggeraxis === "x") {
           referencePoint.x = referencePoint.x * 2;

           if (this.staggerindex === "even") {
             ++referencePoint.x;
           }
         } else {
           referencePoint.y = referencePoint.y * 2;

           if (this.staggerindex === "even") {
             ++referencePoint.y;
           }
         } // Determine the nearest hexagon tile by the distance to the center


         var left, top, centerX, centerY;

         if (this.staggeraxis === "x") {
           left = this.sidelengthx / 2;
           centerX = left + this.columnwidth;
           centerY = this.tileheight / 2;
           this.centers[0].set(left, centerY);
           this.centers[1].set(centerX, centerY - this.rowheight);
           this.centers[2].set(centerX, centerY + this.rowheight);
           this.centers[3].set(centerX + this.columnwidth, centerY);
         } else {
           top = this.sidelengthy / 2;
           centerX = this.tilewidth / 2;
           centerY = top + this.rowheight;
           this.centers[0].set(centerX, top);
           this.centers[1].set(centerX - this.columnwidth, centerY);
           this.centers[2].set(centerX + this.columnwidth, centerY);
           this.centers[3].set(centerX, centerY + this.rowheight);
         }

         var nearest = 0;
         var minDist = Number.MAX_VALUE;
         var dc;

         for (var i = 0; i < 4; ++i) {
           dc = Math.pow(this.centers[i].x - rel.x, 2) + Math.pow(this.centers[i].y - rel.y, 2);

           if (dc < minDist) {
             minDist = dc;
             nearest = i;
           }
         }

         var offsets = this.staggeraxis === "x" ? offsetsStaggerX : offsetsStaggerY;
         q = referencePoint.x + offsets[nearest].x;
         r = referencePoint.y + offsets[nearest].y;
         me.pool.push(referencePoint);
         me.pool.push(rel);
         return ret.set(q, r);
       }