Random Thought of the Day
September 5th, 2024 at 2:34:01 AM permalink | |
DoubleGold Member since: Jan 26, 2023 Threads: 33 Posts: 2878 | I was looking at some property for sale. The listing gave the acreage and the central geographical coordinate of the land (lat, long, alt). I was thinking of modeling a miniature solar updraft tower to see if I could inexpensively generate green power to contribute to an agriculture operation I've been thinking about. I checked out Energy2D software program written by a math expert. It's about solar radiation, convection, and conduction, etc. There was an example of what I was looking for so I tried it. Pretty neat stuff. Anyway, I wanted to write similar code so I could model the land before I bought it using precise dimensions of the existing physical structures and new structures, climate, etc. The software above didn't allow me to be precise in the designing of the structures as I can with a CAD program. So I used the Brave browser "AI feature" to search for "C++ Haversine formula". And in milliseconds, I received the following code: --------------------- double deg2rad(double deg) { return deg * (M_PI / 180.0); } double haversineDistance(double lat1, double lon1, double lat2, double lon2) { const double earthRadius = 6371; // in kilometers lat1 = deg2rad(lat1); lon1 = deg2rad(lon1); lat2 = deg2rad(lat2); lon2 = deg2rad(lon2); double dLat = lat2 - lat1; double dLon = lon2 - lon1; double a = sin(dLat / 2) * sin(dLat / 2) + cos(lat1) * cos(lat2) * sin(dLon / 2) * sin(dLon / 2); double c = 2 * atan2(sqrt(a), sqrt(1 - a)); double distance = earthRadius * c; return distance; } -------------- I haven't tested to see if it's correct yet, but I was pretty impressed of how quickly I could get the sample. I dropped it in, compiled, and linked into a Windows executable in less than two minutes and was writing other code. The code calculates the distance between two geo points accounting for the curvature of the Earth. |
September 6th, 2024 at 4:16:21 AM permalink | |
odiousgambit Member since: Oct 28, 2012 Threads: 158 Posts: 5531 | some shrinkflation can be nearly invisible I had no idea the vitamin bottles I was buying were little more than half full, tho if you had asked me if I noticed they weren't 'quite full' I'd have said yes. These are dark bottles you can see in but not easily. Long story, but I wanted to repurpose empty bottles, and figured I'd have to use a baggie or something. Nope, I was able to pour a definitely-a-lot-left bottle into a new bottle and the remaining bottle is still not completely full, in two different types. I'm Still Standing, Yeah, Yeah, Yeah [it's an old guy chant for me] |
September 6th, 2024 at 5:49:04 AM permalink | |
rxwine Member since: Oct 24, 2012 Threads: 192 Posts: 19504 |
I guess the future could be tiny tiny packs of everything. Everything will look like the little travel section they have in stores. You believe in an invisible god, and dismiss people who say they are trans? Really? |
September 6th, 2024 at 5:52:39 AM permalink | |
rxwine Member since: Oct 24, 2012 Threads: 192 Posts: 19504 | The 3d printer is the caveman Prius version of the Star Trek replicator. It can kinda of make anything appear out of thin air. You believe in an invisible god, and dismiss people who say they are trans? Really? |
September 8th, 2024 at 2:09:48 PM permalink | |
terapined Member since: Aug 6, 2014 Threads: 75 Posts: 12125 | Doing a deep dive into Kit Carson. Visiting his old house tomorrow in Taos NM What an incredible man His last adventure is fascinating A traveling pioneer family is attacked by apachees Man killed Wife and baby kidnapped US soldiers get Kit Carson to help them save the kidnapped woman and baby The soldiers and Kit catch up to the Indians The woman is killed by the Indians in the skirmish Among the women's possessions A book about the great Kit Carson totally embellished making him out to be super human. Kit had a hard time getting over this. He's not super human and it devastated him that he couldn't save the woman that was actually reading about him. Sometimes we live no particular way but our own - Grateful Dead "Eyes of the World" |