processing / processing/processing4
PVector angleBetween returns 0 when x and y of either parameter are both 0
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 494
- Forks
- 183
- Ø Merge
- 4 Std. 39 Min.
- Gemergte PRs (30 T.)
- 3
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne am Einstiegspunkt PVector.angleBetween() und vergleiche das 2D-Verhalten mit dem zugehörigen 3D-Bericht in Issue #2045. Kläre das erwartete Ergebnis, wenn einer der beiden Vektoren (0,0) ist, und überprüfe anschließend das korrigierte Verhalten mit einer Regressionstestabdeckung für diese Fälle.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 56/100