2 Replies Latest reply on Nov 24, 2012 10:53 PM by Johan Louwers

# Distance Calculation between two points

Hi....
can anybody help me out how to find the distance between two points (x1,y1) and (x2,y2)

Thanks and Regards,
Kiran Kumar
• ###### 1. Re: Distance Calculation between two points
Hi,

If you looking oracle spatial solution refer this link.
[http://download.oracle.com/docs/html/A85337_01/sdo_objg.htm#857959]

SELECT SDO_GEOM.SDO_DISTANCE(c_b.shape, m.diminfo, c_d.shape, m.diminfo)
FROM cola_markets c_b, cola_markets c_d, user_sdo_geom_metadata m
WHERE m.table_name = 'COLA_MARKETS' AND m.column_name = 'SHAPE'
AND c_b.name = 'cola_b' AND c_d.name = 'cola_d';

If you looking for spatial formula refer this or google it for 'distance formula'
[http://math.about.com/library/bldistance.htm]

Sujnan
• ###### 2. Re: Distance Calculation between two points
Hi,
you can have a look at this page where you can find some examples on how you can do this without the need for spatial

http://hoopercharles.wordpress.com/2011/06/13/calculate-the-distance-between-two-latitudelongitude-points-using-plain-sql/

Regards,
Johan Louwers.