久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

找到兩個軸承之間的角度

Find the Angle between two Bearings(找到兩個軸承之間的角度)
本文介紹了找到兩個軸承之間的角度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

給定兩個方位角,我如何找到它們之間的最小角度?

Given two bearing, how do I find the smallest angle between them?

例如,如果第一個航向是 340 度,第二個航向是 10 度,那么最小的角度就是 30 度.

So for example if 1 heading is 340 degrees and the second is 10 degrees the smallest angle will be 30 degrees.

我附上了一張圖片來說明我的意思.我試過從另一個中減去一個,但由于圓圈的環繞效果,這不起作用.我也嘗試過使用負度數(180 - 359 是 -180 到 0),但是在嘗試計算正數和負數之間的角度時會搞砸.

I've attached a picture to show what I mean. I've tried subtracting one from the other but that didn't work because of the wrap around effect of a circle. I've also tried using negative degrees (180 - 359 being -180 to 0) but that got messed up when trying to calculate the angle between positive and negative number.

我確信必須有一種更簡單的方法來處理大量 if 語句.

I'm sure there must be an easier way that having lots of if statements.

感謝您的幫助.亞當

順便說一句.這是一個導航問題,所以圓的半徑是未知的.

BTW. This is a navigation question so the radius of the circle is unknown.

推薦答案

float getDifference(float a1, float a2) {
    return Math.min((a1-a2)<0?a1-a2+360:a1-a2, (a2-a1)<0?a2-a1+360:a2-a1)
}

這篇關于找到兩個軸承之間的角度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Upload progress listener not fired (Google drive API)(上傳進度偵聽器未觸發(Google 驅動器 API))
Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
Google Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 無效的 DriveId 和 Null ResourceId)
Google drive api services account view uploaded files to google drive using java(谷歌驅動api服務賬戶查看上傳文件到谷歌驅動使用java)
Google Drive service account returns 403 usageLimits(Google Drive 服務帳號返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
主站蜘蛛池模板: 一区二区三区高清 | 亚洲精品在线免费播放 | 久久久久国产一区二区三区四区 | 99re99| 国产xxx在线观看 | 精品国产欧美一区二区三区不卡 | 欧美区在线观看 | 国产一区 在线视频 | 日韩欧美视频在线 | 国产99久久 | 在线国产一区二区 | 精品久久久久香蕉网 | 久久国产精品视频 | 久久久91 | 亚洲电影免费 | 免费看大片bbbb欧美 | 欧美日韩视频在线播放 | 国产精品久久久久久吹潮日韩动画 | 国产亚洲高清视频 | 在线观看欧美日韩视频 | 久久久久久国产精品免费免费男同 | 午夜一级大片 | 日韩av一区二区在线观看 | 国产精品精品久久久 | 一区二区三区视频在线免费观看 | 成人二区 | 日本午夜视频 | 2023亚洲天堂 | 欧美色偷拍 | 日韩精品视频中文字幕 | 日韩一区欧美一区 | 美女黄色在线观看 | 日韩国产欧美一区 | 国产欧美在线观看 | 北条麻妃国产九九九精品小说 | 亚洲少妇综合网 | 精品九九九 | 欧美成人精品 | 综合久久国产 | 高清国产一区二区 | 亚洲精品一区二区三区在线观看 |