How can I get longitude of ascending node from satellite TLEs with Right Ascension of Ascending Node (RAAN)? - astronomy

As the title says, the TLEs contains RAAN, from which I want to get the longitude of ascending node, as defined in the STK help file as shown in the figure. Is there an open source tool for python to do this? If so, could you give me an example, thanks a lot! Or a formula would also be great.
A starlink TLE examle:
"TLE_LINE0": "0 STARLINK-31",
"TLE_LINE1": "1 44235U 19029A 19145.71984166 .00001593 00000-0 45153-4 0 9991",
"TLE_LINE2": "2 44235 53.0220 167.6233 0006965 280.4784 79.5917 15.42847468 1478",
RAAN here: 167.6233
STK orbit parameters figure:

Related

How to search for all points inside multi polygons which have intersect?

I am working with spatial object in MySQL. I have a table that saves the location of estate in database as "longitude" and "latitude", and I search for these estates inside of polygons that user requests. I am using the st_contains function in MySQL, like this:
select * from estate where ST_CONTAINS(GEOMFROMTEXT(region),POINT(plat,plon)));
In the code snippet region has this format:
"POLYGON((lat1 lng1,lat2 lng2,lat3 lng3,lat4 lng4,lat1 lng1),(lat6 lng6,lat7 lng7,lat8 lng8,lat9 lng9,lat6 lng6))"
Everything works well when polygons have no overlap with each other. However, if polygons have overlap, MySQL subtracts that overlap area and does not retrieve estates in the overlap area. I add this image for more explanation:
How do I make this search work correctly, even with overlapped polygons?
In MySQL, we have the type MULTIPOLYGON for this situation. You can see complete document in MySQL Spatial Data Types.
Your region will need to be defined like this:
"MULTIPOLYGON(((lat1 lng1,lat2 lng2,lat3 lng3,lat4 lng4,lat1 lng1)),((lat6 lng6,lat7 lng7,lat8 lng8,lat9 lng9,lat6 lng6)))"

game - how can I drag objects (cars with numbers) into targets (start line) AS3.0.?

I am having this problem, where I have several cars, numbers and letters, and need to put 5 cars in the starting places. -random order is ok.
I' having trouble finding in AS3 a way so that the EndX and EndY of each object can be in the starting lines and be considered right no matter the order!
I'm having trouble putting the code here so, heres a titanpad with the code:
this is the code:
being (um, dois, tres, quatro) the movieclip instance name for each numbered car.
https://titanpad.com/42vtnCbvLu
First of all, you could probably benefit by using the distance between two points formula and seeing if the distance is less than a certain value rather than checking in all 4 directions manually:
Math.abs(Math.sqrt((x2-x1)^2 + (y2-y1)^2))
Let the position of the car be (x1,y1) and the start position (x2,y2).
This formula will give you the distance between the two points in any direction, and you could test maybe whether this value is less than your offset.
As for the cars in any order part, I'm interpreting that you have your cars and you want the user to drag them to one of 5 spots, a bit like this:
spot1
spot2
spot3
spot4
spot5
All with respective coordinates. My suggestion would be to have a boolean flag for whether each spot is occupied that stops the program checking whether a car is put there after it has been taken once.
Once all these flags are true, then you can proceed.
Hope this helps.

Cesium CZML: using lat long alt

I imagine this is a simple problem for anyone really familiar with Cesium's CZML files. I'm just trying to display a series of lat/long/alt points as a flight path using Cesium. Can someone tell me what the "position" tag should look like?
Unless I'm looking in the wrong places, I don't see a lot of examples for CZML. So it's hard to know what tags can be used and how to use them (and the Java console doesn't show the errors if you get them wrong).
In the Sandcastle CZML example on the Cesium website, the relevant section looks like this:
"position" : {
"interpolationAlgorithm" : "LAGRANGE",
"interpolationDegree" : 1,
"epoch" : "2012-08-04T16:00:00Z",
// Trimmed to just 2 points
"cartesian" : [0.0, -2379754.6637012, -4665332.88013588, 3628133.68924173,
3894.996219574019, -2291336.52323822, -4682359.21232197, 3662718.52171165]
}
If it's two points, why are there 8 values? If it was ECEF coordinates, I would expect only three per point...
For example, when I tried this, I got an "uncaught error" message in the console... which isn't very helpful:
"cartographic" : [-1.472853549, 0.589580778, 1000,
-1.472962668, 0.589739552, 1000 ]
According to the documentation, cartographic takes (long, lat, height) where long and lat are in radians and height is in meters.
The first coordinate is in each set of 4 is time, so it's actually (t, x, y, z). In the example you posted, t is the number of seconds after the specified epoch that the waypoint exists.
You can also use cartographicRadians or cartographicDegrees, but they would still be specified as (t, lon, lat, alt).
If you want to draw a route that is not time-dynamic (i.e. just a static line) you can use the polyline CZML object instead; which has a list of x/y/z positions without time.
Matthews answer is correct, took a littke bit of tweaking to get it working so for others looking at this here is an example showing cartographicDegrees in use.
"position": {
"interpolationAlgorithm": "LAGRANGE",
"interpolationDegree": 1,
"epoch": "2012-08-04T16:00:00Z",
"cartographicDegrees": [
//time, lat, long, alt
0,-116.52,35.02,80,
300,-116.52,35.04,4000,
600,-116.52,35.08,9000,
900,-116.52,35.02,3000,
1100,-116.52,35.02,1000,
1400,-116.52,35.02,100
]
}

MySQL - Trying to find all points inside a Polygon

I am trying to query all from a table of points, all of the points that are inside a certain polygon. I have tried to use st_contains() and for some reason it just won't work.
To made it simple, I have made a table with the points (1,1),(0,0),(100,100) I have used:
GeomFromText('Point(0 0)')
This is my query:
SELECT id, astext(point) FROM points WHERE st_within(point,GeomFromText('Polygon(10 10, 10 -10, -10 -10, -10 10, 10 10)'))
I have also found this question, which made me feel confident that there is something very big that I'm missing...
Please, tell me what I'm doing wrong...
Thanks :)
There are two methods to determine if a point is within a polygon (winding number or the even odd rule).
https://www.youtube.com/watch?v=AHs2Ugxo7-8
http://en.wikipedia.org/wiki/Even%E2%80%93odd_rule
This depends how you wish to treat a polygon.
Apparently, it is very important that the "Polygon Creation String" will use at least 2 sets of parentheses, even if it's a 1-line polygon. for example:
GOOD Polygon Creation:
GeomFromText('Polygon((10 10,10 -10,-10 -10,10 10))')
BAD Polygon Creation:
GeomFromText('Polygon(10 10,10 -10,-10 -10,10 10)')

How to display two or more markers on the same location?

I have a question about the GOOGLE MAP API. If you have more than two data that share similar address, how do you show the Pins Drop on the same address?
Example
You have data such as the following:
Name=>Ray | Address=>Melon Park, California, USA ;
Name=>John | Address=>Melon Park, California, USA ;
Name=>Steve | Address=>Melon Park, California, USA
You want to display 3 Pins Drop for the similar address on Google Map.
The post linked above has some good advice. Your options are really:
Offset the markers slightly, so instead of displaying them all on the same they are all on really close to each other. Just add add or subtract small delta to each of them.
Use different icons for each location. If you know the maximum number of markers that could overlap (like 4?) at the same location, you could make your own rotated icons, so instead of pointing "down" in the typical teardrop shape they could point left, right, or up.
Handle the data overlap in your infowindow / UI.
Adding small delta will work like this (this script is written in PHP):
$random_num_lat = .00065 * mt_rand(1, 10); // delta to the lat value added
$random_num_lng = .00065 * mt_rand(1, 10); // delta to the lon value added
$lat=$row['lat']+$random_num_lat;
$lon=$row['lon']+$random_num_lng;
//now in loop it will be three `enter code here`marker display seperate to each other
while ($row = mysql_fetch_array($query)) {
echo ("addMarker($lat, $lon,'<b>$name</b><br/>$desc1');\n");
}
I achieved this using a "spiderfier" to "spiderfy".
There is a GoogleMaps v3 Spidifier available here (demo).
Leaflet.js can also load GoogleMaps v3 and has a beautiful clustering spidifier available here (demo).
Note: Following is a more of hack than a solution:
Write an algorithm that checks for repeated coordinates in array.
When a duplicate is found, add a small value such as 0.000001 to the found coordinates.
Note that the smaller the value the more you have zoom in to see the difference.