```import numpy as np

[docs]
"""Get angles of links in a graph.

Parameters
----------
graph : `Graph`
A `Graph`.

Returns
-------
ndarray of float
out : ndarray of float, optional
Buffer to place output.

Examples
--------
>>> import numpy as np
>>> from landlab.graph import UniformRectilinearGraph

>>> graph = UniformRectilinearGraph((2, 2))
>>> get_angle_of_link(graph) * 180.0 / np.pi
array([  0.,  90.,  90.,   0.])

>>> angles is rtn
True
"""
if out is None:

np.arctan2(np.diff(y).flat, np.diff(x).flat, out=out)

return np.mod(out, 2.0 * np.pi, out=out)

[docs]
"""Get xy position of the midpoint of links.

Parameters
----------
graph : `Graph`
A `Graph`.
out : ndarray of float, optional
Buffer to place output.

Returns
-------
ndarray of float, shape `(n_links, 2)`

Examples
--------
>>> import numpy as np
>>> from landlab.graph import UniformRectilinearGraph

>>> graph = UniformRectilinearGraph((2, 2))
array([[ 0.5,  0. ],
[ 0. ,  0.5],
[ 1. ,  0.5],
[ 0.5,  1. ]])

>>> points = np.empty((graph.number_of_links, 2), dtype=float)
>>> points is rtn
True
"""

if out is None:

return out

[docs]