Skip to content

Commit eaf4859

Browse files
author
LoneWandererProductions
committed
Factor out Mathematics and Constants
1 parent 45fc75c commit eaf4859

33 files changed

Lines changed: 55 additions & 49 deletions

CommonControls.Converter/ColorToNameConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
using System.Windows.Media;
1414
using System.Linq;
1515

16-
namespace CommonControls.Converters
16+
namespace CommonControls.Converter
1717
{
1818
/// <summary>
1919
/// Converter that converts between a Color and its name as a string for WPF bindings. It uses reflection to find the name of the color in System.Windows.Media.Colors when converting from Color to string, and uses ColorConverter to convert from string to Color.
2020
/// </summary>
21-
/// <seealso cref="System.Windows.Data.IValueConverter" />
21+
/// <seealso cref="IValueConverter" />
2222
public class ColorToNameConverter : IValueConverter
2323
{
2424
/// <summary>

CommonControls/ThumbnailsNew.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Threading;
66
using System.Threading.Tasks;
77
using System.Windows;
8-
using System.Windows.Controls;
98
using System.Windows.Media.Imaging;
109

1110
namespace CommonControls

CommonExtendedObjectsTests/Transactions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
88

9-
using System.Collections.Generic;
10-
using System.Linq;
119
using ExtendedSystemObjects;
1210
using Microsoft.VisualStudio.TestTools.UnitTesting;
1311

CommonLibraryTests/FastMathBenchmarkTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
using System;
1010
using System.Diagnostics;
11-
using Mathematics;
11+
using Mathematics.Constants;
1212
using Microsoft.VisualStudio.TestTools.UnitTesting;
1313

1414
namespace CommonLibraryTests

CoreLibrary.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contracts", "Contracts\Cont
9797
EndProject
9898
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImagingTests", "ImagingTests\ImagingTests.csproj", "{5ECA640F-1980-4BFB-89B1-AA681738D7D8}"
9999
EndProject
100+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mathematics.Constants", "Mathematics.Constants\Mathematics.Constants.csproj", "{F26B0C2D-C08D-47CA-8068-A0EDF8F6B62E}"
101+
EndProject
100102
Global
101103
GlobalSection(SolutionConfigurationPlatforms) = preSolution
102104
Debug|Any CPU = Debug|Any CPU
@@ -255,6 +257,10 @@ Global
255257
{5ECA640F-1980-4BFB-89B1-AA681738D7D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
256258
{5ECA640F-1980-4BFB-89B1-AA681738D7D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
257259
{5ECA640F-1980-4BFB-89B1-AA681738D7D8}.Release|Any CPU.Build.0 = Release|Any CPU
260+
{F26B0C2D-C08D-47CA-8068-A0EDF8F6B62E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
261+
{F26B0C2D-C08D-47CA-8068-A0EDF8F6B62E}.Debug|Any CPU.Build.0 = Debug|Any CPU
262+
{F26B0C2D-C08D-47CA-8068-A0EDF8F6B62E}.Release|Any CPU.ActiveCfg = Release|Any CPU
263+
{F26B0C2D-C08D-47CA-8068-A0EDF8F6B62E}.Release|Any CPU.Build.0 = Release|Any CPU
258264
EndGlobalSection
259265
GlobalSection(SolutionProperties) = preSolution
260266
HideSolutionNode = FALSE

Imaging/Helpers/ImageStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
using System.Runtime.InteropServices;
2323
using ExtendedSystemObjects;
2424
using Imaging.Enums;
25-
using Mathematics;
25+
using Mathematics.Constants;
2626

2727
namespace Imaging.Helpers
2828
{

Imaging/Helpers/ImageStreamHsv.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
using System;
1010
using System.Drawing;
11-
using static OpenTK.Graphics.OpenGL.GL;
1211

1312
namespace Imaging.Helpers
1413
{

Imaging/Helpers/TextureStream.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using System.Drawing;
1212
using System.Drawing.Drawing2D;
1313
using System.Runtime.CompilerServices;
14-
using static OpenTK.Graphics.OpenGL.GL;
1514

1615
// ReSharper disable UnusedMember.Local
1716

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
3-
* PROJECT: ExtendedSystemObjects
4-
* FILE: ExtendedSystemObjects/ExtendedMath.cs
3+
* PROJECT: Mathematics.Constants
4+
* FILE: ExtendedMath.cs
55
* PURPOSE: Helper class that extends some Math functions, mostly comparing double values
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
* SOURCES: https://stackoverflow.com/questions/961038/how-do-i-properly-write-math-extension-methods-for-int-double-float-etc
@@ -10,10 +10,9 @@
1010
// ReSharper disable UnusedMember.Global
1111
// ReSharper disable MemberCanBeInternal
1212

13-
using System;
1413
using System.Runtime.CompilerServices;
1514

16-
namespace Mathematics
15+
namespace Mathematics.Constants
1716
{
1817
/// <summary>
1918
/// Adds some further improvements to certain Math functions
@@ -52,14 +51,14 @@ public static class ExtendedMath
5251

5352
/// <summary>
5453
/// Initializes the <see cref="ExtendedMath" /> class.
55-
/// Precalculate all necessary values.
54+
/// Precalculated necessary values.
5655
/// </summary>
5756
static ExtendedMath()
5857
{
5958
for (var degree = 0; degree < 360; degree++)
6059
{
6160
// SIN Lookup
62-
if (Constants.Sinus.TryGetValue(degree, out var sinValue))
61+
if (MathConstants.Sinus.TryGetValue(degree, out var sinValue))
6362
{
6463
SinDLookup[degree] = sinValue;
6564
SinFLookup[degree] = (float)sinValue;
@@ -71,7 +70,7 @@ static ExtendedMath()
7170
}
7271

7372
// COS Lookup
74-
if (Constants.CoSinus.TryGetValue(degree, out var cosValue))
73+
if (MathConstants.CoSinus.TryGetValue(degree, out var cosValue))
7574
{
7675
CosDLookup[degree] = cosValue;
7776
CosFLookup[degree] = (float)cosValue;
@@ -83,7 +82,7 @@ static ExtendedMath()
8382
}
8483

8584
// TAN Lookup
86-
if (Constants.Tangents.TryGetValue(degree, out var tanValue))
85+
if (MathConstants.Tangents.TryGetValue(degree, out var tanValue))
8786
{
8887
TanDLookup[degree] = tanValue;
8988
TanFLookup[degree] = (float)tanValue;
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
/*
22
* COPYRIGHT: See COPYING in the top level directory
3-
* PROJECT: Mathematics
4-
* FILE: Mathematics/Constants.cs
3+
* PROJECT: Mathematics.Constants
4+
* FILE: MathConstants.cs
55
* PURPOSE: Some Basic Math Constants to increase the correct values.
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
88

99
// ReSharper disable MemberCanBeInternal
1010

11-
using System;
12-
using System.Collections.Generic;
13-
14-
namespace Mathematics
11+
namespace Mathematics.Constants
1512
{
1613
/// <summary>
1714
/// Some Basic Math Constants
1815
/// For future events will be extended
1916
/// </summary>
20-
public static class Constants
17+
public static class MathConstants
2118
{
2219
/// <summary>
2320
/// The SQRT2

0 commit comments

Comments
 (0)