J
Josselin
I have a long formula expressed as a string
formula_1 = "6366.00 * Math.acos(Math.cos(self.latitude) *
Math.cos(latitude) * Math.cos(longitude -self.longitude) +
(Math.sin(self.latitude) * Math.sin(LatitudeRad)) )"
I need to use it in the preparation of some SQL query conditions like :
condition += (c
villes){ 6366.00 * Math.acos(Math.cos(self.latitude) *
Math.cos(latitude) * Math.cos(longitude -self.longitude) +
(Math.sin(self.latitude) * Math.sin(LatitudeRad)) ) < distance } )
How could I write it only once 'formula_1' and reuse it like :
condition += (c
villes){ formula_1 < distance }) # this is wrong as
formula_1 is a string ..
thansk for your suggestions
joss
formula_1 = "6366.00 * Math.acos(Math.cos(self.latitude) *
Math.cos(latitude) * Math.cos(longitude -self.longitude) +
(Math.sin(self.latitude) * Math.sin(LatitudeRad)) )"
I need to use it in the preparation of some SQL query conditions like :
condition += (c
Math.cos(latitude) * Math.cos(longitude -self.longitude) +
(Math.sin(self.latitude) * Math.sin(LatitudeRad)) ) < distance } )
How could I write it only once 'formula_1' and reuse it like :
condition += (c
formula_1 is a string ..
thansk for your suggestions
joss