Le 28/02/2010 17:11, Mike Toews a écrit :
Apply the same COGO trigonometry as before[1]:
import math
class Point:
def __init__(self, x, y):
self.x=x; self.y=y
def TranslateBearingDistance(pt, rad, dist):
return Point(pt.x + dist*math.cos(rad), pt.y + dist*math.sin(rad))
Apply the same COGO trigonometry as before[1]:
import math
class Point:
def __init__(self, x, y):
self.x=x; self.y=y
def TranslateBearingDistance(pt, rad, dist):
return Point(pt.x + dist*math.cos(rad), pt.y + dist*math.sin(rad))
pt0 = Point(100, 100)
# 12 units away at 30
Thank you Marc and Mike
Mike Toews wrote:
On 2010-01-22 19:05, tommy408 wrote:
How can I get a point at a certain distance and degree from another
point.
For example 10 meter distance to another point at 45 degrees.
You could also use some simple trigonometry with ST_Translate().
Hi tommy408,
I would construct a horizontal line with your starting point and the
distance you need and afterwards rotate that line using ST_Rotate
http://postgis.refractions.net/documentation/manual-svn/ST_Rotate.html
The new endpoint should be what you are searching.
Regards,
Marc
On 2010-01-22 19:05, tommy408 wrote:
How can I get a point at a certain distance and degree from another point.
For example 10 meter distance to another point at 45 degrees.
You could also use some simple trigonometry with ST_Translate().
For example, consider 'geom' at (100 100), and a