Ticket #4269 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

The angle() method in V2D and V3D can return NaN even if both vectors are non-zero.

Reported by: Dennis Mikkelson Owned by: Dennis Mikkelson
Priority: major Milestone: Release 2.0
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Andrei Savici

Description

The angle is currently calculated as acos(v1.v2/(|v1
v2|)). Theoretically this is always <= 1 in magnitude. However, due to rounding errors when v1 is essentially equal to v2 or to -v2, the ratio can slightly exceed 1 in magnitude. This causes the acos() function to return NaN, rather than 0 or PI, as it should.

Change History

comment:1 Changed 9 years ago by Dennis Mikkelson

angle() method now always returns a valid value for valid input.

refs #4269

Changeset: 96210bf5946f41cabfa0dde59f97c526d003ff68

comment:2 Changed 9 years ago by Dennis Mikkelson

angle() method now always returns a valid value for valid input.

refs #4269

Changeset: 96210bf5946f41cabfa0dde59f97c526d003ff68

comment:3 Changed 9 years ago by Dennis Mikkelson

  • Status changed from new to accepted

comment:4 Changed 9 years ago by Dennis Mikkelson

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:5 Changed 9 years ago by Andrei Savici

  • Status changed from verify to verifying
  • Tester set to Andrei Savici

comment:6 Changed 9 years ago by Andrei Savici

  • Status changed from verifying to closed

Works as described

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5116

Note: See TracTickets for help on using tickets.