From a30e502bc4554127e3181d6a620a1f71502a2ac3 Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Mon, 22 Apr 2024 21:27:51 -0500 Subject: [PATCH] Calculation Helper --- CapyKit/Enumerations/MeasurementSystem.cs | 20 +++ CapyKit/Helpers/CalculationHelper.cs | 160 ++++++++++++++++++ CapyKit/Helpers/LanguageHelper.cs | 9 +- ...lculationHelper_EARTH_RADIUS_KILOMETERS.md | 31 ++++ ...s_CalculationHelper_MILES_PER_KILOMETER.md | 31 ++++ ...CapyKit_Helpers_CalculationHelper_chars.md | 31 ++++ ...lds_T_CapyKit_Helpers_CalculationHelper.md | 24 +++ ...Helpers_CalculationHelper_CalculateHash.md | 41 +++++ ...pers_CalculationHelper_CalculateHexHash.md | 38 +++++ ...pers_CalculationHelper_DegreesToRadians.md | 38 +++++ ...t_Helpers_CalculationHelper_GetDistance.md | 57 +++++++ ...Helpers_CalculationHelper_GetDistance_1.md | 56 ++++++ ...ers_CalculationHelper_KilometersToMiles.md | 38 +++++ ...ers_CalculationHelper_MilesToKilometers.md | 38 +++++ ...pers_CalculationHelper_RadiansToDegrees.md | 38 +++++ ...LanguageHelper_CamelCaseToHumanReadable.md | 3 + ...ods_T_CapyKit_Helpers_CalculationHelper.md | 39 +++++ Documentation/Help/N_CapyKit_Enumerations.md | 13 ++ Documentation/Help/N_CapyKit_Helpers.md | 5 +- ...t_Helpers_CalculationHelper_GetDistance.md | 19 +++ Documentation/Help/R_Project_Documentation.md | 3 + ..._CapyKit_Enumerations_MeasurementSystem.md | 39 +++++ .../T_CapyKit_Helpers_CalculationHelper.md | 73 ++++++++ .../Help/T_CapyKit_Helpers_LanguageHelper.md | 2 +- .../Help/Working/_InheritedDocs_.xml | 13 ++ Documentation/Help/_Sidebar.md | 17 ++ 26 files changed, 873 insertions(+), 3 deletions(-) create mode 100644 CapyKit/Enumerations/MeasurementSystem.cs create mode 100644 CapyKit/Helpers/CalculationHelper.cs create mode 100644 Documentation/Help/F_CapyKit_Helpers_CalculationHelper_EARTH_RADIUS_KILOMETERS.md create mode 100644 Documentation/Help/F_CapyKit_Helpers_CalculationHelper_MILES_PER_KILOMETER.md create mode 100644 Documentation/Help/F_CapyKit_Helpers_CalculationHelper_chars.md create mode 100644 Documentation/Help/Fields_T_CapyKit_Helpers_CalculationHelper.md create mode 100644 Documentation/Help/M_CapyKit_Helpers_CalculationHelper_CalculateHash.md create mode 100644 Documentation/Help/M_CapyKit_Helpers_CalculationHelper_CalculateHexHash.md create mode 100644 Documentation/Help/M_CapyKit_Helpers_CalculationHelper_DegreesToRadians.md create mode 100644 Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance.md create mode 100644 Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance_1.md create mode 100644 Documentation/Help/M_CapyKit_Helpers_CalculationHelper_KilometersToMiles.md create mode 100644 Documentation/Help/M_CapyKit_Helpers_CalculationHelper_MilesToKilometers.md create mode 100644 Documentation/Help/M_CapyKit_Helpers_CalculationHelper_RadiansToDegrees.md create mode 100644 Documentation/Help/Methods_T_CapyKit_Helpers_CalculationHelper.md create mode 100644 Documentation/Help/N_CapyKit_Enumerations.md create mode 100644 Documentation/Help/Overload_CapyKit_Helpers_CalculationHelper_GetDistance.md create mode 100644 Documentation/Help/T_CapyKit_Enumerations_MeasurementSystem.md create mode 100644 Documentation/Help/T_CapyKit_Helpers_CalculationHelper.md create mode 100644 Documentation/Help/Working/_InheritedDocs_.xml diff --git a/CapyKit/Enumerations/MeasurementSystem.cs b/CapyKit/Enumerations/MeasurementSystem.cs new file mode 100644 index 0000000..333930d --- /dev/null +++ b/CapyKit/Enumerations/MeasurementSystem.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapyKit.Enumerations +{ + /// + /// An enumeration representing different measurement systems. + /// + public enum MeasurementSystem + { + /// The imperial measurement system. + Imperial = 0, + + /// The metric measurement system. + Metric = 1 + } +} diff --git a/CapyKit/Helpers/CalculationHelper.cs b/CapyKit/Helpers/CalculationHelper.cs new file mode 100644 index 0000000..63e667f --- /dev/null +++ b/CapyKit/Helpers/CalculationHelper.cs @@ -0,0 +1,160 @@ +using CapyKit.Enumerations; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace CapyKit.Helpers +{ + /// Static class providing helper methods for various calculations. + public static class CalculationHelper + { + #region Members + + /// The earth's radius in kilometers. + public const int EARTH_RADIUS_KILOMETERS = 6371; + + /// Ratio of miles per kilometer . + public const double MILES_PER_KILOMETER = 0.621371; + + /// The valid hexidecimal characters. + private const string chars = "0123456789ABCDEF"; + + #endregion Members + + #region Methods + + /// + /// Calculates the hash of a given string using an value as the first 32 bits. + /// + /// The string to be hashed. + /// The calculated hash. + /// + /// This method is used for a quick and consistent hash function. It should not be considered + /// cryptographically sound or used in security contexts. + /// + public static int CalculateHash(string str) + { + MD5 md5Hasher = MD5.Create(); + var md5Hash = md5Hasher.ComputeHash(Encoding.UTF8.GetBytes(str)); + var hash = BitConverter.ToInt32(md5Hash, 0); + + return hash; + } + + /// Calculates the hexadecimal hash. + /// The string to be hashed. + /// The calculated 16 character hexadecimal hash. + public static string CalculateHexHash(string str) + { + byte[] bytes = Encoding.UTF8.GetBytes(str); + + MD5 md5Hasher = MD5.Create(); + byte[] hash = md5Hasher.ComputeHash(bytes); + + char[] hash2 = new char[16]; + + // Note that here we are wasting bits of hash! + // But it isn't really important, because hash.Length == 32 + for (int i = 0; i < hash2.Length; i++) + { + hash2[i] = CalculationHelper.chars[hash[i] % CalculationHelper.chars.Length]; + } + + return new string(hash2); + } + + /// + /// Gets the distance between two points on earth using the haversine formula. + /// + /// The latitude origin. + /// The longitude origin. + /// The latitude destination. + /// The longitude destination. + /// (Optional) The measurement system. + /// The distance. + /// + /// Uses the haversine formula + /// to calculate the "as-the-crow-flies" distance between two points on earth. + /// + /// + public static decimal GetDistance(decimal latitudeOrigin, decimal longitudeOrigin, decimal latitudeDestination, decimal longitudeDestination, MeasurementSystem measurementSystem = MeasurementSystem.Imperial) + { + double latitudeOriginalDouble = Convert.ToDouble(latitudeOrigin); + double longitudeOriginDouble = Convert.ToDouble(longitudeOrigin); + double latitudeDestinationDouble = Convert.ToDouble(latitudeDestination); + double longitudeDestinationDouble = Convert.ToDouble(longitudeDestination); + + var result = GetDistance(latitudeOriginalDouble, longitudeOriginDouble, latitudeDestinationDouble, longitudeDestinationDouble, measurementSystem); + + return Convert.ToDecimal(result); + } + + /// Gets the distance between two points on earth using the haversine formula. + /// The latitude of the origin. + /// The longitude of the origin. + /// The latitude destination. + /// The longitude destination. + /// (Optional) The measurement system. + /// The distance. + /// + /// Uses the haversine formula + /// to calculate the "as-the-crow-flies" distance between two points on earth. + /// + public static double GetDistance(double latitudeOrigin, double longitudeOrigin, double latitudeDestination, double longitudeDestination, MeasurementSystem measurementSystem = MeasurementSystem.Imperial) + { + var thetaLatitude = DegreesToRadians(latitudeOrigin); + var thetaLongitude = DegreesToRadians(longitudeOrigin); + var deltaLatitude = DegreesToRadians(latitudeDestination - latitudeOrigin); + var deltaLongitude = DegreesToRadians(longitudeDestination - longitudeOrigin); + + var haversineTheta = Math.Sin(deltaLatitude / 2) * Math.Sin(deltaLatitude / 2) + Math.Cos(thetaLatitude) * Math.Cos(thetaLongitude) * Math.Sin(deltaLongitude / 2) * Math.Sin(deltaLongitude / 2); + var angularDistance = 2 * Math.Atan2(Math.Sqrt(haversineTheta), Math.Sqrt(1 - haversineTheta)); + + var distance = EARTH_RADIUS_KILOMETERS * angularDistance; + + if (measurementSystem == MeasurementSystem.Imperial) + { + return KilometersToMiles(distance); + } + + return distance; + } + + /// Converts kilometers to miles. + /// The value in kilometers. + /// The value in miles. + public static double KilometersToMiles(double kilometers) + { + return kilometers * MILES_PER_KILOMETER; + } + + /// Converts miles to kilometers. + /// The value in miles. + /// The value in kilometers. + public static double MilesToKilometers(double miles) + { + return miles / MILES_PER_KILOMETER; + } + + /// Convers degrees to radians. + /// The degree value. + /// The value as radians. + public static double DegreesToRadians(double degrees) + { + return degrees * Math.PI / 180.0; + } + + /// Converts radians to degrees. + /// The radian value. + /// The value as degrees. + public static double RadiansToDegrees(double radians) + { + return radians * 180.0 / Math.PI; + } + + #endregion Methods + } +} diff --git a/CapyKit/Helpers/LanguageHelper.cs b/CapyKit/Helpers/LanguageHelper.cs index ec68d91..b8e13a9 100644 --- a/CapyKit/Helpers/LanguageHelper.cs +++ b/CapyKit/Helpers/LanguageHelper.cs @@ -7,11 +7,18 @@ using System.Threading.Tasks; namespace CapyKit.Helpers { + /// + /// Helper class for handling text transformations. + /// public class LanguageHelper { #region Methods - + /// Converts camel case text to human readable text. + /// + /// Camel case is a naming convention for identifiers in which the first letter of each word is + /// capitalized. + /// /// The value. /// A string in human readable format. public static string CamelCaseToHumanReadable(string value) diff --git a/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_EARTH_RADIUS_KILOMETERS.md b/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_EARTH_RADIUS_KILOMETERS.md new file mode 100644 index 0000000..777c5d2 --- /dev/null +++ b/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_EARTH_RADIUS_KILOMETERS.md @@ -0,0 +1,31 @@ +# EARTH_RADIUS_KILOMETERS Field + + +The earth's radius in kilometers. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public const int EARTH_RADIUS_KILOMETERS = 6371 +``` +**F#** +``` F# +static val mutable EARTH_RADIUS_KILOMETERS: int +``` + + + +#### Field Value +Int32 + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_MILES_PER_KILOMETER.md b/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_MILES_PER_KILOMETER.md new file mode 100644 index 0000000..fdbad0f --- /dev/null +++ b/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_MILES_PER_KILOMETER.md @@ -0,0 +1,31 @@ +# MILES_PER_KILOMETER Field + + +Ratio of miles per kilometer . + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public const double MILES_PER_KILOMETER = 0.621371 +``` +**F#** +``` F# +static val mutable MILES_PER_KILOMETER: float +``` + + + +#### Field Value +Double + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_chars.md b/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_chars.md new file mode 100644 index 0000000..457bb61 --- /dev/null +++ b/Documentation/Help/F_CapyKit_Helpers_CalculationHelper_chars.md @@ -0,0 +1,31 @@ +# chars Field + + +The valid hexidecimal characters. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +private const string chars = "0123456789ABCDEF" +``` +**F#** +``` F# +static val mutable private chars: string +``` + + + +#### Field Value +String + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/Fields_T_CapyKit_Helpers_CalculationHelper.md b/Documentation/Help/Fields_T_CapyKit_Helpers_CalculationHelper.md new file mode 100644 index 0000000..21929a7 --- /dev/null +++ b/Documentation/Help/Fields_T_CapyKit_Helpers_CalculationHelper.md @@ -0,0 +1,24 @@ +# CalculationHelper Fields + + + + +## Fields + + + + + + + + + + +
charsThe valid hexidecimal characters.
EARTH_RADIUS_KILOMETERSThe earth's radius in kilometers.
MILES_PER_KILOMETERRatio of miles per kilometer .
+ +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_CalculateHash.md b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_CalculateHash.md new file mode 100644 index 0000000..8b2a0dc --- /dev/null +++ b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_CalculateHash.md @@ -0,0 +1,41 @@ +# CalculateHash Method + + +Calculates the hash of a given string using an MD5 value as the first 32 bits. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static int CalculateHash( + string str +) +``` +**F#** +``` F# +static member CalculateHash : + str : string -> int +``` + + + +#### Parameters +
  String
The string to be hashed.
+ +#### Return Value +Int32 +The calculated hash. + +## Remarks +This method is used for a quick and consistent hash function. It should not be considered cryptographically sound or used in security contexts. + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_CalculateHexHash.md b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_CalculateHexHash.md new file mode 100644 index 0000000..07ce2a8 --- /dev/null +++ b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_CalculateHexHash.md @@ -0,0 +1,38 @@ +# CalculateHexHash Method + + +Calculates the hexadecimal hash. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static string CalculateHexHash( + string str +) +``` +**F#** +``` F# +static member CalculateHexHash : + str : string -> string +``` + + + +#### Parameters +
  String
The string to be hashed.
+ +#### Return Value +String +The calculated 16 character hexadecimal hash. + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_DegreesToRadians.md b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_DegreesToRadians.md new file mode 100644 index 0000000..3cd35c2 --- /dev/null +++ b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_DegreesToRadians.md @@ -0,0 +1,38 @@ +# DegreesToRadians Method + + +Convers degrees to radians. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static double DegreesToRadians( + double degrees +) +``` +**F#** +``` F# +static member DegreesToRadians : + degrees : float -> float +``` + + + +#### Parameters +
  Double
The degree value.
+ +#### Return Value +Double +The value as radians. + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance.md b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance.md new file mode 100644 index 0000000..50937a3 --- /dev/null +++ b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance.md @@ -0,0 +1,57 @@ +# GetDistance(Decimal, Decimal, Decimal, Decimal, MeasurementSystem) Method + + +Gets the distance between two points on earth using the `haversine` formula. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static decimal GetDistance( + decimal latitudeOrigin, + decimal longitudeOrigin, + decimal latitudeDestination, + decimal longitudeDestination, + MeasurementSystem measurementSystem = MeasurementSystem.Imperial +) +``` +**F#** +``` F# +static member GetDistance : + latitudeOrigin : decimal * + longitudeOrigin : decimal * + latitudeDestination : decimal * + longitudeDestination : decimal * + ?measurementSystem : MeasurementSystem +(* Defaults: + let _measurementSystem = defaultArg measurementSystem MeasurementSystem.Imperial +*) +-> decimal +``` + + + +#### Parameters +
  Decimal
The latitude origin.
  Decimal
The longitude origin.
  Decimal
The latitude destination.
  Decimal
The longitude destination.
  MeasurementSystem  (Optional)
(Optional) The measurement system.
+ +#### Return Value +Decimal +The distance. + +## Remarks +Uses the + +haversine formula to calculate the "as-the-crow-flies" distance between two points on earth. + +## See Also + + +#### Reference +CalculationHelper Class +GetDistance Overload +CapyKit.Helpers Namespace +GetDistance(Double, Double, Double, Double, MeasurementSystem) diff --git a/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance_1.md b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance_1.md new file mode 100644 index 0000000..bff9246 --- /dev/null +++ b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance_1.md @@ -0,0 +1,56 @@ +# GetDistance(Double, Double, Double, Double, MeasurementSystem) Method + + +Gets the distance between two points on earth using the `haversine` formula. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static double GetDistance( + double latitudeOrigin, + double longitudeOrigin, + double latitudeDestination, + double longitudeDestination, + MeasurementSystem measurementSystem = MeasurementSystem.Imperial +) +``` +**F#** +``` F# +static member GetDistance : + latitudeOrigin : float * + longitudeOrigin : float * + latitudeDestination : float * + longitudeDestination : float * + ?measurementSystem : MeasurementSystem +(* Defaults: + let _measurementSystem = defaultArg measurementSystem MeasurementSystem.Imperial +*) +-> float +``` + + + +#### Parameters +
  Double
The latitude of the origin.
  Double
The longitude of the origin.
  Double
The latitude destination.
  Double
The longitude destination.
  MeasurementSystem  (Optional)
(Optional) The measurement system.
+ +#### Return Value +Double +The distance. + +## Remarks +Uses the + +haversine formula to calculate the "as-the-crow-flies" distance between two points on earth. + +## See Also + + +#### Reference +CalculationHelper Class +GetDistance Overload +CapyKit.Helpers Namespace diff --git a/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_KilometersToMiles.md b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_KilometersToMiles.md new file mode 100644 index 0000000..da17e87 --- /dev/null +++ b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_KilometersToMiles.md @@ -0,0 +1,38 @@ +# KilometersToMiles Method + + +Converts kilometers to miles. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static double KilometersToMiles( + double kilometers +) +``` +**F#** +``` F# +static member KilometersToMiles : + kilometers : float -> float +``` + + + +#### Parameters +
  Double
The value in kilometers.
+ +#### Return Value +Double +The value in miles. + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_MilesToKilometers.md b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_MilesToKilometers.md new file mode 100644 index 0000000..fc87480 --- /dev/null +++ b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_MilesToKilometers.md @@ -0,0 +1,38 @@ +# MilesToKilometers Method + + +Converts miles to kilometers. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static double MilesToKilometers( + double miles +) +``` +**F#** +``` F# +static member MilesToKilometers : + miles : float -> float +``` + + + +#### Parameters +
  Double
The value in miles.
+ +#### Return Value +Double +The value in kilometers. + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_RadiansToDegrees.md b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_RadiansToDegrees.md new file mode 100644 index 0000000..f7ce870 --- /dev/null +++ b/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_RadiansToDegrees.md @@ -0,0 +1,38 @@ +# RadiansToDegrees Method + + +Converts radians to degrees. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static double RadiansToDegrees( + double radians +) +``` +**F#** +``` F# +static member RadiansToDegrees : + radians : float -> float +``` + + + +#### Parameters +
  Double
The radian value.
+ +#### Return Value +Double +The value as degrees. + +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/M_CapyKit_Helpers_LanguageHelper_CamelCaseToHumanReadable.md b/Documentation/Help/M_CapyKit_Helpers_LanguageHelper_CamelCaseToHumanReadable.md index cbdaf67..1f96a5e 100644 --- a/Documentation/Help/M_CapyKit_Helpers_LanguageHelper_CamelCaseToHumanReadable.md +++ b/Documentation/Help/M_CapyKit_Helpers_LanguageHelper_CamelCaseToHumanReadable.md @@ -30,6 +30,9 @@ static member CamelCaseToHumanReadable : String A string in human readable format. +## Remarks +Camel case is a naming convention for identifiers in which the first letter of each word is capitalized. + ## See Also diff --git a/Documentation/Help/Methods_T_CapyKit_Helpers_CalculationHelper.md b/Documentation/Help/Methods_T_CapyKit_Helpers_CalculationHelper.md new file mode 100644 index 0000000..a60e872 --- /dev/null +++ b/Documentation/Help/Methods_T_CapyKit_Helpers_CalculationHelper.md @@ -0,0 +1,39 @@ +# CalculationHelper Methods + + + + +## Methods + + + + + + + + + + + + + + + + + + + + + + + + + +
CalculateHashCalculates the hash of a given string using an MD5 value as the first 32 bits.
CalculateHexHashCalculates the hexadecimal hash.
DegreesToRadiansConvers degrees to radians.
GetDistance(Decimal, Decimal, Decimal, Decimal, MeasurementSystem)Gets the distance between two points on earth using the haversine formula.
GetDistance(Double, Double, Double, Double, MeasurementSystem)Gets the distance between two points on earth using the haversine formula.
KilometersToMilesConverts kilometers to miles.
MilesToKilometersConverts miles to kilometers.
RadiansToDegreesConverts radians to degrees.
+ +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/N_CapyKit_Enumerations.md b/Documentation/Help/N_CapyKit_Enumerations.md new file mode 100644 index 0000000..7085ef2 --- /dev/null +++ b/Documentation/Help/N_CapyKit_Enumerations.md @@ -0,0 +1,13 @@ +# CapyKit.Enumerations Namespace + + +\[Missing <summary> documentation for "N:CapyKit.Enumerations"\] + + + +## Enumerations + + + + +
MeasurementSystemAn enumeration representing different measurement systems.
\ No newline at end of file diff --git a/Documentation/Help/N_CapyKit_Helpers.md b/Documentation/Help/N_CapyKit_Helpers.md index 5755b4a..4048a74 100644 --- a/Documentation/Help/N_CapyKit_Helpers.md +++ b/Documentation/Help/N_CapyKit_Helpers.md @@ -8,11 +8,14 @@ ## Classes + + + - + diff --git a/Documentation/Help/Overload_CapyKit_Helpers_CalculationHelper_GetDistance.md b/Documentation/Help/Overload_CapyKit_Helpers_CalculationHelper_GetDistance.md new file mode 100644 index 0000000..3bb0a1a --- /dev/null +++ b/Documentation/Help/Overload_CapyKit_Helpers_CalculationHelper_GetDistance.md @@ -0,0 +1,19 @@ +# GetDistance Method + + +## Overload List +
CalculationHelperStatic class providing helper methods for various calculations.
CompressionHelper A class that contains methods for managing data compression.
LanguageHelper 
Helper class for handling text transformations.
SecurityHelper A class that contains methods for managing secure data processing and cryptography.
+ + + + + + +
GetDistance(Decimal, Decimal, Decimal, Decimal, MeasurementSystem)Gets the distance between two points on earth using the haversine formula.
GetDistance(Double, Double, Double, Double, MeasurementSystem)Gets the distance between two points on earth using the haversine formula.
+ +## See Also + + +#### Reference +CalculationHelper Class +CapyKit.Helpers Namespace diff --git a/Documentation/Help/R_Project_Documentation.md b/Documentation/Help/R_Project_Documentation.md index 8252610..48d9d88 100644 --- a/Documentation/Help/R_Project_Documentation.md +++ b/Documentation/Help/R_Project_Documentation.md @@ -12,6 +12,9 @@ CapyKit.Attributes +CapyKit.Enumerations + + CapyKit.Extensions diff --git a/Documentation/Help/T_CapyKit_Enumerations_MeasurementSystem.md b/Documentation/Help/T_CapyKit_Enumerations_MeasurementSystem.md new file mode 100644 index 0000000..4db7bb4 --- /dev/null +++ b/Documentation/Help/T_CapyKit_Enumerations_MeasurementSystem.md @@ -0,0 +1,39 @@ +# MeasurementSystem Enumeration + + +An enumeration representing different measurement systems. + + + +## Definition +**Namespace:** CapyKit.Enumerations +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public enum MeasurementSystem +``` +**F#** +``` F# +type MeasurementSystem +``` + + + +## Members + + + + + + + + + +
Imperial0The imperial measurement system.
Metric1The metric measurement system.
+ +## See Also + + +#### Reference +CapyKit.Enumerations Namespace diff --git a/Documentation/Help/T_CapyKit_Helpers_CalculationHelper.md b/Documentation/Help/T_CapyKit_Helpers_CalculationHelper.md new file mode 100644 index 0000000..9412395 --- /dev/null +++ b/Documentation/Help/T_CapyKit_Helpers_CalculationHelper.md @@ -0,0 +1,73 @@ +# CalculationHelper Class + + +Static class providing helper methods for various calculations. + + + +## Definition +**Namespace:** CapyKit.Helpers +**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 + +**C#** +``` C# +public static class CalculationHelper +``` +**F#** +``` F# +[] +[] +type CalculationHelper = class end +``` + + +
InheritanceObject → CalculationHelper
+ + + +## Methods + + + + + + + + + + + + + + + + + + + + + + + + + +
CalculateHashCalculates the hash of a given string using an MD5 value as the first 32 bits.
CalculateHexHashCalculates the hexadecimal hash.
DegreesToRadiansConvers degrees to radians.
GetDistance(Decimal, Decimal, Decimal, Decimal, MeasurementSystem)Gets the distance between two points on earth using the haversine formula.
GetDistance(Double, Double, Double, Double, MeasurementSystem)Gets the distance between two points on earth using the haversine formula.
KilometersToMilesConverts kilometers to miles.
MilesToKilometersConverts miles to kilometers.
RadiansToDegreesConverts radians to degrees.
+ +## Fields + + + + + + + + + + +
charsThe valid hexidecimal characters.
EARTH_RADIUS_KILOMETERSThe earth's radius in kilometers.
MILES_PER_KILOMETERRatio of miles per kilometer .
+ +## See Also + + +#### Reference +CapyKit.Helpers Namespace diff --git a/Documentation/Help/T_CapyKit_Helpers_LanguageHelper.md b/Documentation/Help/T_CapyKit_Helpers_LanguageHelper.md index c406195..bb86139 100644 --- a/Documentation/Help/T_CapyKit_Helpers_LanguageHelper.md +++ b/Documentation/Help/T_CapyKit_Helpers_LanguageHelper.md @@ -1,7 +1,7 @@ # LanguageHelper Class -\[Missing <summary> documentation for "T:CapyKit.Helpers.LanguageHelper"\] +Helper class for handling text transformations. diff --git a/Documentation/Help/Working/_InheritedDocs_.xml b/Documentation/Help/Working/_InheritedDocs_.xml new file mode 100644 index 0000000..0bbb14e --- /dev/null +++ b/Documentation/Help/Working/_InheritedDocs_.xml @@ -0,0 +1,13 @@ + + + _InheritedDocs_ + + + + +Returns a string that represents the current object.A string that represents the current object. + + + Gets the name of the algorithm. + + \ No newline at end of file diff --git a/Documentation/Help/_Sidebar.md b/Documentation/Help/_Sidebar.md index efa14f5..c696319 100644 --- a/Documentation/Help/_Sidebar.md +++ b/Documentation/Help/_Sidebar.md @@ -97,6 +97,8 @@ - [EnumerationDescriptionAttribute Constructor](M_CapyKit_Attributes_EnumerationDescriptionAttribute__ctor.md) - [EnumerationDescriptionAttribute Properties](Properties_T_CapyKit_Attributes_EnumerationDescriptionAttribute.md) - [EnumerationDescriptionAttribute Methods](Methods_T_CapyKit_Attributes_EnumerationDescriptionAttribute.md) + - [CapyKit.Enumerations Namespace](N_CapyKit_Enumerations.md) + - [MeasurementSystem Enumeration](T_CapyKit_Enumerations_MeasurementSystem.md) - [CapyKit.Extensions Namespace](N_CapyKit_Extensions.md) - [EnumerationExtensions Class](T_CapyKit_Extensions_EnumerationExtensions.md) - [EnumerationExtensions Methods](Methods_T_CapyKit_Extensions_EnumerationExtensions.md) @@ -128,6 +130,21 @@ - [IfNullOrEmpty Method](M_CapyKit_Extensions_StringExtensions_IfNullOrEmpty.md) - [IfNullOrWhiteSpace Method](M_CapyKit_Extensions_StringExtensions_IfNullOrWhiteSpace.md) - [CapyKit.Helpers Namespace](N_CapyKit_Helpers.md) + - [CalculationHelper Class](T_CapyKit_Helpers_CalculationHelper.md) + - [CalculationHelper Methods](Methods_T_CapyKit_Helpers_CalculationHelper.md) + - [CalculateHash Method](M_CapyKit_Helpers_CalculationHelper_CalculateHash.md) + - [CalculateHexHash Method](M_CapyKit_Helpers_CalculationHelper_CalculateHexHash.md) + - [DegreesToRadians Method](M_CapyKit_Helpers_CalculationHelper_DegreesToRadians.md) + - [GetDistance Method](Overload_CapyKit_Helpers_CalculationHelper_GetDistance.md) + - [GetDistance(Decimal, Decimal, Decimal, Decimal, MeasurementSystem) Method](M_CapyKit_Helpers_CalculationHelper_GetDistance.md) + - [GetDistance(Double, Double, Double, Double, MeasurementSystem) Method](M_CapyKit_Helpers_CalculationHelper_GetDistance_1.md) + - [KilometersToMiles Method](M_CapyKit_Helpers_CalculationHelper_KilometersToMiles.md) + - [MilesToKilometers Method](M_CapyKit_Helpers_CalculationHelper_MilesToKilometers.md) + - [RadiansToDegrees Method](M_CapyKit_Helpers_CalculationHelper_RadiansToDegrees.md) + - [CalculationHelper Fields](Fields_T_CapyKit_Helpers_CalculationHelper.md) + - [chars Field](F_CapyKit_Helpers_CalculationHelper_chars.md) + - [EARTH_RADIUS_KILOMETERS Field](F_CapyKit_Helpers_CalculationHelper_EARTH_RADIUS_KILOMETERS.md) + - [MILES_PER_KILOMETER Field](F_CapyKit_Helpers_CalculationHelper_MILES_PER_KILOMETER.md) - [CompressionHelper Class](T_CapyKit_Helpers_CompressionHelper.md) - [CompressionHelper Methods](Methods_T_CapyKit_Helpers_CompressionHelper.md) - [Compress Method](M_CapyKit_Helpers_CompressionHelper_Compress.md)