diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-12-01 11:03:19 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-12-01 11:03:19 +0200 |
| commit | ca8e9ce5fefeafa6da4476435361d64c8b8fe600 (patch) | |
| tree | 11d89a80f6aa91de730d7bcfee3c46bf6c006567 /Software/Visual_Studio/PPC/Modules | |
| parent | acf59049bd08d74cd6fb6eb25679b07b7d8f3b15 (diff) | |
| download | Tango-ca8e9ce5fefeafa6da4476435361d64c8b8fe600.tar.gz Tango-ca8e9ce5fefeafa6da4476435361d64c8b8fe600.zip | |
PPC. FT Check bounds argument of arc cosine.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs index 0ba23f352..042350cb0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/VisualOffsetModel.cs @@ -382,8 +382,14 @@ namespace Tango.PPC.Jobs.Models double refX_SH = refX_SC * (refX_T * refX_F + 1 - refX_F); if(C1 != 0) { - double tmp = (180 / Math.PI) * Math.Acos(1 - (refX_SH * refX_SH * hueOffset * hueOffset / (2 * C1 * C1))); - if (hueOffset < 0)//?????? + var argum = 1 - (refX_SH * refX_SH * hueOffset * hueOffset / (2 * C1 * C1)); + if(argum < -1) + argum = -1; + if (argum > 1) + argum = 1; + + double tmp = (180 / Math.PI) * Math.Acos(argum); + if (hueOffset < 0)//? tmp *= -1; H1 += tmp; } |
