PVector angleBetween returns 0 when x and y of either parameter are both 0

オープン
#1,544 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java
領域
api

調査の方向性

PVector.angleBetween() のエントリーポイントから始め、issue #2045 の関連する 3D レポートと 2D の動作を比較してください。どちらか一方のベクトルが (0,0) の場合に期待される結果を明確にし、その後、それらのケースに対するリグレッションカバレッジで修正後の動作を検証してください。

索引モデルが issue の本文から書いたものです。

説明

I found an existing report describing similar behavior with 3D PVectors (https://github.com/processing/processing/issues/2045), but it appears the same problem affects 2D PVectors as well.

When either the start or end PVector is (0,0) the output of angleBetween() is always 0.

I'm not particularly experienced with Processing, so it's entirely possible that I'm misunderstanding something or using the API incorrectly. I tend to pick it up every few months for small projects and then promptly forget most of what I learned.

That said, I've spent some time testing this behavior and looking into the implementation, and based on what I found, I would not expect the angle to be 0 in the cases I tested.

Edit: I forgot to add, I'm using processing 4.5.2

Image
主要言語
Java
スター
497
フォーク
183
平均マージ
4時間 39分
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

processing/processing4 のほかの issue

processing/processing4 の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。