Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-j 51
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-j 51
22_23-j 51
Commits
21c8ce93
Commit
21c8ce93
authored
Apr 07, 2023
by
Hasith Yoman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calculate lingitude latitude distance
parent
5af6b0d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
fuel-sliit-bakend-main/app/Http/Controllers/StationController.php
...it-bakend-main/app/Http/Controllers/StationController.php
+10
-0
No files found.
fuel-sliit-bakend-main/app/Http/Controllers/StationController.php
View file @
21c8ce93
...
...
@@ -31,6 +31,16 @@ class StationController extends Controller
}
return
response
()
->
json
([
'respond'
=>
$respond
,
'count'
=>
$queue
]);
}
// calculate distance
public
function
calculateDistance
(
$lat1
,
$lon1
,
$lat2
,
$lon2
)
{
$theta
=
$lon1
-
$lon2
;
$dist
=
sin
(
deg2rad
(
$lat1
))
*
sin
(
deg2rad
(
$lat2
))
+
cos
(
deg2rad
(
$lat1
))
*
cos
(
deg2rad
(
$lat2
))
*
cos
(
deg2rad
(
$theta
));
$dist
=
acos
(
$dist
);
$dist
=
rad2deg
(
$dist
);
$miles
=
$dist
*
60
*
1.1515
;
$km
=
$miles
*
1.609344
;
return
round
(
$km
,
2
);
}
// This function for create a new Station with user
public
function
create_station
(
Request
$req
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment