Related to : Flickering rectangle using AS3 and drawRect() when using math for coordinates

Given the coordinates how to find if they make a rectangle using C++ programms? 
check this clever solution from this link
find the center of mass of corner points: cx=(x1+x2+x3+x4)/4,
cy=(y1+y2+y3+y4)/4
test if square of distances from center of mass to all 4 corners are
equal
bool isRectangle(double x1, double y1,
double x2, double y2,
double x3, double y3,
double x4, double y4)
{
double cx,cy;

R: Need to populate a matrix with counts of coordinates (from data frame with list of coordinates, some of which are duplicates) 
Here's one approach, using the data.table and Matrix packages:
library(data.table)
library(Matrix)
f < function(df, nx, ny) {
## Tally up the frequencies
dt < data.table(df, key=c("x", "y"))
xyN < dt[, .N, by=key(dt)]
## Place counts in matrix in their respective i/j x/y row/column
as.matrix(with(xyN, sparseMatrix(i=x,j=y,x=N,dims=c(nx,ny))))
}
## Check that it

Is it possible to convert Pointer Coordinates to Map Coordinates (Location / Geocoordinates)? 
Why not grab the coordinate information from the pushpin. That's the
coordinate you are likely using in your collection. Try something like
this:
int locToRemove = MapLayer.GetPosition(p);
DataLayer.Children.Remove(p);

UIView class properties seemingly disappear when I call drawRect: 
This is a nasty one!
I think you have 2 instances of PlayingCardView:
Your view connected to your IBOutlet in Interface Builder
Your (same) view in IB where/because you have not set the class to
PlayingCardView.
So that drawRect call is actually happening on the PlayingCardView in
your IB when it is loaded from IB and not on the "outlet" view where
you are setting the rank and suit.
I am gu

astlib coordinates code to astropy coordinates code 
This is one way to do it:
In [1]: import numpy as np
In [2]: from astropy import units as u
In [3]: from astropy.coordinates import SkyCoord, FK4, FK5, Galactic
In [4]: clra = np.zeros(3)
In [5]: cldec = np.zeros(3)
In [6]: c1 = SkyCoord(clra * u.deg, cldec * u.deg, frame=FK4)
In [7]: c2 = c1.transform_to(FK5(equinox='J2000'))
In [8]: c3 = c2.transform_to(Galactic)
In [9]: print(c3.l.degr
