Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8117210

Point3D.angle() returns NaN for valid input due to calculation errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      8.0-graphics-scrum-b1274-x64

      Description

      Point3D.angle() is is NaN for the following points:
      Point3D [x = -0.8944271909999159, y = 0.0, z = 0.4472135954999579] and
      Point3D [x = -0.894427190999924, y = 4.061090000458082E-14, z = 0.4472135954999417]

      Run attached code to reproduce this.

      Internally acos is invoked on value that is slightly greater than 1 due to calculation errors: "c = 1.0000000000000002".

        Attachments

        1. Bug.java
          3 kB
          Alexander Kuznetcov

          Activity

            People

            Assignee:
            psafrata Pavel Ĺ afrata
            Reporter:
            mrkam Alexander Kuznetcov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: