原点と座標から角度
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Excelのように一番下まで計算したら次は1番上の値を使うやり方を教えてください。 一番下の式の例 =1/2(B86×A1-A86×B1)
あと、原点とあるxとy座標からθを出したい(0から360度まで)のですが、Arctanだと上手く行きません。どうしたらよいですか。
0 commentaires
Réponses (1)
Akira Agata
le 26 Oct 2020
後半のご質問は、atan2d 関数を使うことで解決できます。ただし -180 ~ +180 度の値を返すので、これを 0 ~ 360 度に変換する必要があります。たとえば以下のようなやり方はいかがでしょうか?
% 例として、x軸とベクトル (x,y) = (1,1) のなす角度 (=45度) を求めます
x = 1;
y = 1;
theta = mod(atan2d(y,x)+360,360);
結果は以下のようになります。
>> theta
theta =
45
さて前半のご質問ですが、あいにく文面から内容を十分把握できませんでした。お手数ですが、ご質問内容の詳細を教えてもらえないでしょうか?
1 commentaire
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!