127 references to PI
Microsoft.AspNetCore.Components.Tests (2)
SupplyParameterFromPersistentComponentStateValueProviderTests.cs (2)
228{ Math.PI, -Math.PI },
Microsoft.DotNet.XUnitAssert.Tests (3)
Sdk\ArgumentFormatterTests.cs (3)
134 var floatPI = (float)Math.PI; 146 Assert.Equal(Math.PI.ToString("G17"), ArgumentFormatter.Format(Math.PI));
Microsoft.Maui (6)
Animations\Easing.cs (3)
31 public static readonly Easing SinOut = new(x => Math.Sin(x * Math.PI * 0.5f)); 36 public static readonly Easing SinIn = new(x => 1.0f - Math.Cos(x * Math.PI * 0.5f)); 41 public static readonly Easing SinInOut = new(x => -Math.Cos(Math.PI * x) / 2.0f + 0.5f);
Platform\ViewExtensions.cs (1)
40 internal static double ExtractAngleInDegrees(this Matrix4x4 matrix) => ExtractAngleInRadians(matrix) * 180 / Math.PI;
Primitives\SwipeDirection.cs (2)
31 double rad = Math.Atan2(y1 - y2, x2 - x1) + Math.PI; 32 return (rad * 180 / Math.PI + 180) % 360;
Microsoft.Maui.Controls (18)
Shapes\GeometryHelper.cs (7)
76 double x = elipGeoSrc.Center.X + elipGeoSrc.RadiusX * Math.Sin(i * 2 * Math.PI / max); 77 double y = elipGeoSrc.Center.Y - elipGeoSrc.RadiusY * Math.Cos(i * 2 * Math.PI / max); 322 if (Math.IEEERemainder(sweep + 0.000005, Math.PI) < 0.000010) 328 bool isAcute = sweep < Math.PI; 335 angle1 += 2 * Math.PI; 337 angle2 += 2 * Math.PI; 344 int max = (int)(4 * (radiusX + radiusY) * Math.Abs(angle2 - angle1) / (2 * Math.PI) / tolerance);
Shapes\Matrix.cs (8)
95 this *= CreateRotationRadians(angle * (Math.PI / 180.0)); 102 this = CreateRotationRadians(angle * (Math.PI / 180.0)) * this; 109 this *= CreateRotationRadians(angle * (Math.PI / 180.0), centerX, centerY); 116 this = CreateRotationRadians(angle * (Math.PI / 180.0), centerX, centerY) * this; 148 this *= CreateSkewRadians(skewX * (Math.PI / 180.0), 149 skewY * (Math.PI / 180.0)); 157 this = CreateSkewRadians(skewX * (Math.PI / 180.0), 158 skewY * (Math.PI / 180.0)) * this;
Shapes\RotateTransform.cs (1)
72 double radians = Math.PI * Angle / 180;
Shapes\SkewTransform.cs (2)
86 double radiansX = Math.PI * AngleX / 180; 87 double radiansY = Math.PI * AngleY / 180;
Microsoft.Maui.Essentials (2)
UnitConverters\UnitConverters.shared.cs (2)
10 const double twoPi = 2.0 * Math.PI; 13 const double degreesToRadians = Math.PI / 180.0;
Microsoft.Maui.Graphics (2)
GeometryUtil.cs (2)
35 return Math.PI * angle / 180; 45 return angle * (180 / Math.PI);
Microsoft.Maui.Maps (4)
Primitives\GeographyUtils.cs (2)
12 public static double ToRadians(this double degrees) => degrees * Math.PI / 180.0; 14 public static double ToDegrees(this double radians) => radians / Math.PI * 180.0;
Primitives\MapSpan.cs (2)
8 const double EarthCircumferenceKm = GeographyUtils.EarthRadiusKm * 2 * Math.PI; 102 return EarthCircumferenceKm * Math.Cos(location.Latitude * Math.PI / 180.0);
Microsoft.ML.AutoML (4)
Sweepers\SweeperProbabilityUtils.cs (2)
16return 1 / Math.Sqrt(2 * Math.PI) * Math.Exp(-Math.Pow(x, 2) / 2); 41rvs.Add(mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2));
Tuner\SmacTuner.cs (1)
291var newFeatured = mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2);
Utils\RandomNumberGenerator.cs (1)
37double std = Math.Sqrt(-2.0 * Math.Log(u)) * Math.Sin(2.0 * Math.PI * v);
Microsoft.ML.Core (2)
Utilities\MathUtils.cs (1)
296private static readonly double _constantForLogGamma = 0.5 * Math.Log(2 * Math.PI);
Utilities\Stats.cs (1)
224return (float)Math.Tan(Math.PI * (rand.NextSingle() - 0.5));
Microsoft.ML.CpuMath (2)
ProbabilityFunctions.cs (2)
83double cc = Math.Sqrt(Math.PI) / 2.0; 84double ccinc = Math.PI / 4.0;
Microsoft.ML.Data (2)
Transforms\NormalizeColumnDbl.cs (1)
1489return (TFloat)(0.5 + 0.5 * Math.Sign(x) * Math.Sqrt(1 - Math.Exp(-x2 * (4 / Math.PI + ax2) / (1 + ax2))));
Transforms\NormalizeColumnSng.cs (1)
1652return (TFloat)(0.5 + 0.5 * Math.Sign(x) * Math.Sqrt(1 - Math.Exp(-x2 * (4 / Math.PI + ax2) / (1 + ax2))));
Microsoft.ML.GenAI.Core (1)
Module\NewGELUActivation.cs (1)
23using var result3 = Math.Sqrt(2.0 / Math.PI) * result2;
Microsoft.ML.Samples (1)
Dynamic\Transforms\TimeSeries\DetectSeasonality.cs (1)
18var seasonalData = Enumerable.Range(0, 100).Select(x => new TimeSeriesData(Math.Sin(2 * Math.PI + x)));
Microsoft.ML.StandardTrainers (1)
Optimizer\DifferentiableFunction.cs (1)
360return (float)(Math.Sqrt(-2 * Math.Log(a)) * MathUtils.Cos(2 * Math.PI * b));
Microsoft.ML.Sweeper (4)
Algorithms\SweeperProbabilityUtils.cs (3)
33return 1 / Math.Sqrt(2 * Math.PI * variance) * Math.Exp(-Math.Pow(x - mean, 2) / (2 * variance)); 46return 1 / Math.Sqrt(2 * Math.PI) * Math.Exp(-Math.Pow(x, 2) / 2); 71rvs.Add(mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2));
SynthConfigRunner.cs (1)
90total += Math.Pow(val, 2) - 10 * Math.Cos(2 * Math.PI * val);
Microsoft.ML.Tests (2)
Scenarios\ClusteringTests.cs (2)
40clusters[i] = new ClusteringData { Points = new float[2] { (float)Math.Cos(Math.PI * i * 2 / k), (float)Math.Sin(Math.PI * i * 2 / k) } };
Microsoft.ML.TimeSeries (7)
AdaptiveSingularSpectrumSequenceModeler.cs (7)
867Double highFrequenceyBoundry = Math.PI / 2; 888if (roots[i].Magnitude > 1 && (Math.Abs(roots[i].Phase) <= eps || Math.Abs(Math.Abs(roots[i].Phase) - Math.PI) <= eps)) 897if (roots[i].Magnitude >= 1 && 2 * Math.PI / Math.Abs(roots[i].Phase) > _windowSize) 1051if ((highFrequenceyBoundry < roots[i].Phase && roots[i].Phase < Math.PI - eps) || 1052(-Math.PI + eps < roots[i].Phase && roots[i].Phase < -highFrequenceyBoundry)) 1065else if (Math.Abs(phase - Math.PI) <= eps) 1067else if (Math.Abs(phase + Math.PI) <= eps)
Microsoft.ML.TimeSeries.Tests (1)
TimeSeriesDirectApi.cs (1)
1070Value = Math.Sin(2 * Math.PI + x),
Microsoft.ML.TorchSharp (1)
NasBert\Modules\ActivationFunction.cs (1)
64private readonly double _alpha = Math.Sqrt(2 / Math.PI);
Microsoft.ML.Transforms (12)
Expression\BuiltinFunctions.cs (11)
427return Math.PI; 533return (R4)(a * (180 / Math.PI)); 539return a * (180 / Math.PI); 545return (R4)(a * (Math.PI / 180)); 551return a * (Math.PI / 180); 569return (R4)Math.Sin(a * (Math.PI / 180)); 575return MathUtils.Sin(a * (Math.PI / 180)); 593return (R4)Math.Cos(a * (Math.PI / 180)); 599return MathUtils.Cos(a * (Math.PI / 180)); 611return (R4)Math.Tan(a * (Math.PI / 180)); 617return Math.Tan(a * (Math.PI / 180));
RandomFourierFeaturizing.cs (1)
195RotationTerms[i] = (_rand.NextSingle() - (float)0.5) * (float)Math.PI;
PresentationCore (27)
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (1)
1391double dAngle = (tdrd.Transform[0] / 100) * (Math.PI / 180);
MS\Internal\Ink\StrokeRenderer.cs (6)
1048angle = Math.PI / 2.0; 1052angle = Math.PI * 3.0 / 2.0; 1063angle = Math.PI; 1070angle = Math.Atan(dy / dx) + Math.PI; 1074angle = Math.Atan(dy / dx) + (2 * Math.PI); 1083angle = angle * 180 / Math.PI;
MS\Internal\Media3D\M3DUtil.cs (2)
374return radians*(180.0/Math.PI); 379return degrees*(Math.PI/180.0);
System\Windows\Input\AngleUtil.cs (2)
13return degrees * Math.PI / 180.0; 21return radians * 180.0 / Math.PI;
System\Windows\Input\Stylus\Pointer\PointerFlickEngine.cs (1)
463return ((180 * radians / Math.PI) + 360) % 360;
System\Windows\Media\Animation\BackEase.cs (1)
44return Math.Pow(normalizedTime, 3.0) - normalizedTime * amp * Math.Sin(Math.PI * normalizedTime);
System\Windows\Media\Animation\DoubleAnimationUsingPath.cs (1)
294double angle = Math.Acos(x) * (180.0 / Math.PI);
System\Windows\Media\Animation\ElasticEase.cs (2)
83return expo * (Math.Sin((Math.PI * 2.0 * oscillations + Math.PI * 0.5) * normalizedTime));
System\Windows\Media\Animation\SineEase.cs (1)
15return 1.0 - Math.Sin(Math.PI * 0.5 * (1 - normalizedTime));
System\Windows\Media\Effects\DropShadowEffect.cs (1)
39double direction = Math.PI/180 * Direction;
System\Windows\Media\EllipseGeometry.cs (1)
236double area = Math.Abs(RadiusX * RadiusY) * Math.PI;
System\Windows\Media\LinearGradientBrush.cs (1)
210angle = angle * (1.0/180.0) * System.Math.PI;
System\Windows\Media\RectangleGeometry.cs (1)
286area -= Math.Abs(radiusX * radiusY) * (4.0 - Math.PI);
System\Windows\Media3D\AxisAngleRotation3D.cs (2)
120Math.E, Math.PI, Math.E * Math.PI, 55.0
System\Windows\Media3D\Quaternion.cs (3)
69double angleInRadians = angleInDegrees * (Math.PI / 180.0); 160return Math.Atan2(msin,mcos) * (360.0 / Math.PI); 541double theta = t * Math.PI;
System\Windows\Media3D\Vector3D.cs (1)
167theta = Math.PI - 2.0 * Math.Asin((-vector1 - vector2).Length / 2.0);
PresentationFramework (1)
System\Windows\Documents\TextStore.cs (1)
2849double angleCos = Math.Round((radCos * 180) / Math.PI, 0);
ReachFramework (4)
AlphaFlattener\BrushProxy.cs (1)
4138double rotateAngle = Math.Atan2(-gradientVector.Y, gradientVector.X) * 180.0 / Math.PI;
Serialization\DrawingContextFlattener.cs (3)
462private const double PI_OVER_180 = Math.PI / 180; // PI/180 577rAngle += Math.PI * 2; 584rAngle -= Math.PI * 2;
System.Drawing.Common.Tests (1)
System\Drawing\Drawing2D\GraphicsPathTests.cs (1)
30private const float Pi4 = (float)(Math.PI / 4);
System.Numerics.Tensors (1)
System\Numerics\Tensors\netcore\Tensor.cs (1)
469span[i] = T.CreateChecked(Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2));
System.Private.CoreLib (4)
src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
71public const double Pi = Math.PI;
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendricalCalculationsHelper.cs (2)
36return degree * Math.PI / 180; 241const double Divisor = 2 * Math.PI;
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (1)
447double w = 2 * Math.PI / period;
System.Runtime.Numerics (1)
System\Numerics\Complex.cs (1)
442if (value.Real < 0.0) u = Math.PI - u;
System.Windows.Input.Manipulations (10)
System\Windows\Input\Manipulations\ManipulationSequence.cs (6)
896if (delta > Math.PI) 897delta -= Math.PI * 2.0; 898if (delta < -Math.PI) 899delta += Math.PI * 2.0; 1163float value2 = value + (float)(2 * Math.PI); 1164float value3 = value - (float)(2 * Math.PI);
System\Windows\Input\Manipulations\VectorF.cs (4)
411if (angle > Math.PI) 413angle -= Math.PI * 2.0; 415else if (angle < -Math.PI) 417angle += Math.PI * 2.0;
WinFormsControlsTest (1)
ChartControl.cs (1)
22double yValue = (1.0 + Math.Sin(angle / 180.0 * Math.PI)) * 10.0;