127 references to 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)
16
return 1 / Math.Sqrt(2 * Math.
PI
) * Math.Exp(-Math.Pow(x, 2) / 2);
41
rvs.Add(mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.
PI
* u2));
Tuner\SmacTuner.cs (1)
291
var newFeatured = mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.
PI
* u2);
Utils\RandomNumberGenerator.cs (1)
37
double std = Math.Sqrt(-2.0 * Math.Log(u)) * Math.Sin(2.0 * Math.
PI
* v);
Microsoft.ML.Core (2)
Utilities\MathUtils.cs (1)
296
private static readonly double _constantForLogGamma = 0.5 * Math.Log(2 * Math.
PI
);
Utilities\Stats.cs (1)
224
return (float)Math.Tan(Math.
PI
* (rand.NextSingle() - 0.5));
Microsoft.ML.CpuMath (2)
ProbabilityFunctions.cs (2)
83
double cc = Math.Sqrt(Math.
PI
) / 2.0;
84
double ccinc = Math.
PI
/ 4.0;
Microsoft.ML.Data (2)
Transforms\NormalizeColumnDbl.cs (1)
1489
return (TFloat)(0.5 + 0.5 * Math.Sign(x) * Math.Sqrt(1 - Math.Exp(-x2 * (4 / Math.
PI
+ ax2) / (1 + ax2))));
Transforms\NormalizeColumnSng.cs (1)
1652
return (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)
23
using var result3 = Math.Sqrt(2.0 / Math.
PI
) * result2;
Microsoft.ML.Samples (1)
Dynamic\Transforms\TimeSeries\DetectSeasonality.cs (1)
18
var seasonalData = Enumerable.Range(0, 100).Select(x => new TimeSeriesData(Math.Sin(2 * Math.
PI
+ x)));
Microsoft.ML.StandardTrainers (1)
Optimizer\DifferentiableFunction.cs (1)
360
return (float)(Math.Sqrt(-2 * Math.Log(a)) * MathUtils.Cos(2 * Math.
PI
* b));
Microsoft.ML.Sweeper (4)
Algorithms\SweeperProbabilityUtils.cs (3)
33
return 1 / Math.Sqrt(2 * Math.
PI
* variance) * Math.Exp(-Math.Pow(x - mean, 2) / (2 * variance));
46
return 1 / Math.Sqrt(2 * Math.
PI
) * Math.Exp(-Math.Pow(x, 2) / 2);
71
rvs.Add(mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.
PI
* u2));
SynthConfigRunner.cs (1)
90
total += Math.Pow(val, 2) - 10 * Math.Cos(2 * Math.
PI
* val);
Microsoft.ML.Tests (2)
Scenarios\ClusteringTests.cs (2)
40
clusters[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)
867
Double highFrequenceyBoundry = Math.
PI
/ 2;
888
if (roots[i].Magnitude > 1 && (Math.Abs(roots[i].Phase) <= eps || Math.Abs(Math.Abs(roots[i].Phase) - Math.
PI
) <= eps))
897
if (roots[i].Magnitude >= 1 && 2 * Math.
PI
/ Math.Abs(roots[i].Phase) > _windowSize)
1051
if ((highFrequenceyBoundry < roots[i].Phase && roots[i].Phase < Math.
PI
- eps) ||
1052
(-Math.
PI
+ eps < roots[i].Phase && roots[i].Phase < -highFrequenceyBoundry))
1065
else if (Math.Abs(phase - Math.
PI
) <= eps)
1067
else if (Math.Abs(phase + Math.
PI
) <= eps)
Microsoft.ML.TimeSeries.Tests (1)
TimeSeriesDirectApi.cs (1)
1070
Value = Math.Sin(2 * Math.
PI
+ x),
Microsoft.ML.TorchSharp (1)
NasBert\Modules\ActivationFunction.cs (1)
64
private readonly double _alpha = Math.Sqrt(2 / Math.
PI
);
Microsoft.ML.Transforms (12)
Expression\BuiltinFunctions.cs (11)
427
return Math.
PI
;
533
return (R4)(a * (180 / Math.
PI
));
539
return a * (180 / Math.
PI
);
545
return (R4)(a * (Math.
PI
/ 180));
551
return a * (Math.
PI
/ 180);
569
return (R4)Math.Sin(a * (Math.
PI
/ 180));
575
return MathUtils.Sin(a * (Math.
PI
/ 180));
593
return (R4)Math.Cos(a * (Math.
PI
/ 180));
599
return MathUtils.Cos(a * (Math.
PI
/ 180));
611
return (R4)Math.Tan(a * (Math.
PI
/ 180));
617
return Math.Tan(a * (Math.
PI
/ 180));
RandomFourierFeaturizing.cs (1)
195
RotationTerms[i] = (_rand.NextSingle() - (float)0.5) * (float)Math.
PI
;
PresentationCore (27)
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (1)
1391
double dAngle = (tdrd.Transform[0] / 100) * (Math.
PI
/ 180);
MS\Internal\Ink\StrokeRenderer.cs (6)
1048
angle = Math.
PI
/ 2.0;
1052
angle = Math.
PI
* 3.0 / 2.0;
1063
angle = Math.
PI
;
1070
angle = Math.Atan(dy / dx) + Math.
PI
;
1074
angle = Math.Atan(dy / dx) + (2 * Math.
PI
);
1083
angle = angle * 180 / Math.
PI
;
MS\Internal\Media3D\M3DUtil.cs (2)
374
return radians*(180.0/Math.
PI
);
379
return degrees*(Math.
PI
/180.0);
System\Windows\Input\AngleUtil.cs (2)
13
return degrees * Math.
PI
/ 180.0;
21
return radians * 180.0 / Math.
PI
;
System\Windows\Input\Stylus\Pointer\PointerFlickEngine.cs (1)
463
return ((180 * radians / Math.
PI
) + 360) % 360;
System\Windows\Media\Animation\BackEase.cs (1)
44
return Math.Pow(normalizedTime, 3.0) - normalizedTime * amp * Math.Sin(Math.
PI
* normalizedTime);
System\Windows\Media\Animation\DoubleAnimationUsingPath.cs (1)
294
double angle = Math.Acos(x) * (180.0 / Math.
PI
);
System\Windows\Media\Animation\ElasticEase.cs (2)
83
return expo * (Math.Sin((Math.
PI
* 2.0 * oscillations + Math.
PI
* 0.5) * normalizedTime));
System\Windows\Media\Animation\SineEase.cs (1)
15
return 1.0 - Math.Sin(Math.
PI
* 0.5 * (1 - normalizedTime));
System\Windows\Media\Effects\DropShadowEffect.cs (1)
39
double direction = Math.
PI
/180 * Direction;
System\Windows\Media\EllipseGeometry.cs (1)
236
double area = Math.Abs(RadiusX * RadiusY) * Math.
PI
;
System\Windows\Media\LinearGradientBrush.cs (1)
210
angle = angle * (1.0/180.0) * System.Math.
PI
;
System\Windows\Media\RectangleGeometry.cs (1)
286
area -= Math.Abs(radiusX * radiusY) * (4.0 - Math.
PI
);
System\Windows\Media3D\AxisAngleRotation3D.cs (2)
120
Math.E, Math.
PI
, Math.E * Math.
PI
, 55.0
System\Windows\Media3D\Quaternion.cs (3)
69
double angleInRadians = angleInDegrees * (Math.
PI
/ 180.0);
160
return Math.Atan2(msin,mcos) * (360.0 / Math.
PI
);
541
double theta = t * Math.
PI
;
System\Windows\Media3D\Vector3D.cs (1)
167
theta = Math.
PI
- 2.0 * Math.Asin((-vector1 - vector2).Length / 2.0);
PresentationFramework (1)
System\Windows\Documents\TextStore.cs (1)
2849
double angleCos = Math.Round((radCos * 180) / Math.
PI
, 0);
ReachFramework (4)
AlphaFlattener\BrushProxy.cs (1)
4138
double rotateAngle = Math.Atan2(-gradientVector.Y, gradientVector.X) * 180.0 / Math.
PI
;
Serialization\DrawingContextFlattener.cs (3)
462
private const double PI_OVER_180 = Math.
PI
/ 180; // PI/180
577
rAngle += Math.
PI
* 2;
584
rAngle -= Math.
PI
* 2;
System.Numerics.Tensors (2)
System\Numerics\Tensors\netcore\Tensor.cs (2)
385
span[i] = T.CreateChecked(Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.
PI
* u2));
396
enumerator.Current = T.CreateChecked(Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.
PI
* u2));
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
71
public const double Pi = Math.
PI
;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendricalCalculationsHelper.cs (2)
36
return degree * Math.
PI
/ 180;
241
const double Divisor = 2 * Math.
PI
;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (1)
447
double w = 2 * Math.
PI
/ period;
System.Speech (3)
Internal\Synthesis\PcmConverter.cs (3)
305
dArg = 2.0f * Math.
PI
* dCutOff;
310
dSinc = dGain * Math.Sin(dArg * i) / (Math.
PI
* i) * pdWindow[_iFilterHalf - i];
428
dArg = 2.0 * Math.
PI
;
System.Windows.Forms (4)
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\SystemButtonDarkModeRenderer.cs (4)
215
bounds.Right - (int)(radius * Math.Sin(Math.
PI
/ 4)),
216
bounds.Top + (int)(radius * (1 - Math.Cos(Math.
PI
/ 4))),
260
bounds.Left + (int)(radius * (1 - Math.Cos(Math.
PI
/ 4))),
261
bounds.Bottom - (int)(radius * Math.Sin(Math.
PI
/ 4)),
System.Windows.Input.Manipulations (10)
System\Windows\Input\Manipulations\ManipulationSequence.cs (6)
896
if (delta > Math.
PI
)
897
delta -= Math.
PI
* 2.0;
898
if (delta < -Math.
PI
)
899
delta += Math.
PI
* 2.0;
1163
float value2 = value + (float)(2 * Math.
PI
);
1164
float value3 = value - (float)(2 * Math.
PI
);
System\Windows\Input\Manipulations\VectorF.cs (4)
411
if (angle > Math.
PI
)
413
angle -= Math.
PI
* 2.0;
415
else if (angle < -Math.
PI
)
417
angle += Math.
PI
* 2.0;