Hello Jignesh,
In my view, there are basically two solutions to your problem.
1. Use javaScript to perform the functions
Create the necessary functions in javaScript and use the result to update/query Sqlite.
JavaScript is well suited for trigonometry; sine, cosine and tangent. JavaScript can calculate advanced mathematical problems extremely fast.
Example: Calculating the answer to the following problem
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 +...
+ 10^2 = 385. The square of the sum of the first ten natural numbers is, (1 + 2 + ... + >10)^2 = 55^2 = 3025. Hence the difference between the sum of the squares of the first ten >natural numbers and the square of the sum is 3025 – 385 = 2640. Find the difference >between the sum of the squares of the first one hundred natural numbers and the square of >the sum.
function Problem_6() {
"use strict";
var i = 1, ns = 0, sqs = 0;
do {
ns += i;
sqs += i * i;
i += 1;
} while (i <= 100);
return ns * ns - sqs;
}
Answer: 25164150
This example is from Rolando Garza’s El blog de rolandog, based on his own extension to javaScript’s Global Math Object; Math.js.
References:
Mozilla’s JavaScript References for the Global Math Object:
Trigonometry—sine, cosine and tangent with JavaScript, by JJ Gifford.
GeoNames is an open source database over geographical information about most countries, cities, and villages in the world, including latitude and longitude as well as distances to other geo-locations.
GeoNames is available both as a webservice through a JSON API, and as downloadable tables.
Example: Finding the nearest intersection for the given latitude/longitude
http://api.geonames.org/findNearestIntersectionOSMJSON?lat=37.451&lng=-122.18&username=demo
{"intersection":{"street2":"Curtis Street","street1":"Roble Avenue","distance":"0.08","highway2":"residential","highway1":"residential","lng":"-122.1808166","lat":"37.4506308"}}
Store required geo-information locally in Sqlite.
More information: http://www.geonames.org/