Python numpy.ma.arctan2() Examples
The following are 10
code examples of numpy.ma.arctan2().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
numpy.ma
, or try the search function
.
Example #1
Source File: quiver.py From Computable with MIT License | 5 votes |
def _angles_lengths(self, U, V, eps=1): xy = self.ax.transData.transform(self.XY) uv = np.hstack((U[:, np.newaxis], V[:, np.newaxis])) xyp = self.ax.transData.transform(self.XY + eps * uv) dxy = xyp - xy angles = np.arctan2(dxy[:, 1], dxy[:, 0]) lengths = np.absolute(dxy[:, 0] + dxy[:, 1] * 1j) / eps return angles, lengths
Example #2
Source File: quiver.py From matplotlib-4-abaqus with MIT License | 5 votes |
def _angles_lengths(self, U, V, eps=1): xy = self.ax.transData.transform(self.XY) uv = np.hstack((U[:, np.newaxis], V[:, np.newaxis])) xyp = self.ax.transData.transform(self.XY + eps * uv) dxy = xyp - xy angles = np.arctan2(dxy[:, 1], dxy[:, 0]) lengths = np.absolute(dxy[:, 0] + dxy[:, 1] * 1j) / eps return angles, lengths
Example #3
Source File: quiver.py From neural-network-animation with MIT License | 5 votes |
def _angles_lengths(self, U, V, eps=1): xy = self.ax.transData.transform(self.XY) uv = np.hstack((U[:, np.newaxis], V[:, np.newaxis])) xyp = self.ax.transData.transform(self.XY + eps * uv) dxy = xyp - xy angles = np.arctan2(dxy[:, 1], dxy[:, 0]) lengths = np.absolute(dxy[:, 0] + dxy[:, 1] * 1j) / eps return angles, lengths
Example #4
Source File: quiver.py From GraphicDesignPatternByPython with MIT License | 5 votes |
def _angles_lengths(self, U, V, eps=1): xy = self.ax.transData.transform(self.XY) uv = np.column_stack((U, V)) xyp = self.ax.transData.transform(self.XY + eps * uv) dxy = xyp - xy angles = np.arctan2(dxy[:, 1], dxy[:, 0]) lengths = np.hypot(*dxy.T) / eps return angles, lengths
Example #5
Source File: quiver.py From python3_ios with BSD 3-Clause "New" or "Revised" License | 5 votes |
def _angles_lengths(self, U, V, eps=1): xy = self.ax.transData.transform(self.XY) uv = np.column_stack((U, V)) xyp = self.ax.transData.transform(self.XY + eps * uv) dxy = xyp - xy angles = np.arctan2(dxy[:, 1], dxy[:, 0]) lengths = np.hypot(*dxy.T) / eps return angles, lengths
Example #6
Source File: stages.py From aws-greengrass-mini-fulfillment with Apache License 2.0 | 5 votes |
def cart2polar(x, y, degrees=True): """ Convert cartesian X and Y to polar RHO and THETA. :param x: x cartesian coordinate :param y: y cartesian coordinate :param degrees: True = return theta in degrees, False = return theta in radians. [default: True] :return: r, theta """ rho = ma.sqrt(x ** 2 + y ** 2) theta = ma.arctan2(y, x) if degrees: theta *= (180 / math.pi) return rho, theta
Example #7
Source File: quiver.py From coffeegrindsize with MIT License | 5 votes |
def _angles_lengths(self, U, V, eps=1): xy = self.ax.transData.transform(self.XY) uv = np.column_stack((U, V)) xyp = self.ax.transData.transform(self.XY + eps * uv) dxy = xyp - xy angles = np.arctan2(dxy[:, 1], dxy[:, 0]) lengths = np.hypot(*dxy.T) / eps return angles, lengths
Example #8
Source File: testing.py From CogAlg with MIT License | 5 votes |
def _compare(self): dy, dx = compare_slices(self._i, self._rng, operator=angle_diff) self._derts[1:][central_slice(self._rng)] += np.concatenate((dy, dx)) self._derts[0] = ma.hypot( ma.arctan2(*self.dy), ma.arctan2(*self.dx), ) self._derts[rim_mask(self._i.shape, rng)] = ma.masked return self # ----------------------------------------------------------------------------- # Functions
Example #9
Source File: quiver.py From CogAlg with MIT License | 5 votes |
def _angles_lengths(self, U, V, eps=1): xy = self.ax.transData.transform(self.XY) uv = np.column_stack((U, V)) xyp = self.ax.transData.transform(self.XY + eps * uv) dxy = xyp - xy angles = np.arctan2(dxy[:, 1], dxy[:, 0]) lengths = np.hypot(*dxy.T) / eps return angles, lengths
Example #10
Source File: quiver.py From twitter-stock-recommendation with MIT License | 5 votes |
def _angles_lengths(self, U, V, eps=1): xy = self.ax.transData.transform(self.XY) uv = np.hstack((U[:, np.newaxis], V[:, np.newaxis])) xyp = self.ax.transData.transform(self.XY + eps * uv) dxy = xyp - xy angles = np.arctan2(dxy[:, 1], dxy[:, 0]) lengths = np.hypot(*dxy.T) / eps return angles, lengths