This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: Javascript works in radians. | |
// | |
// pa, pb, pc are 3 points. Each point is an array with 2 values; x and y | |
// | |
function triangleCalculations(pa, pb, pc) { | |
var a = lineLength(pc, pb); // Length of line from c to b. | |
var b = lineLength(pa, pc); // Length of line from a to c. | |
var c = lineLength(pa, pb); // Length of line from a to b. | |
//var A = Math.acos(((b * b) + (c * c) - (a * a)) / (2 * b * c)); // Angle at point a. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertToRoman(num) { | |
var romanNumerals = [ | |
{number: 1, numeral: "I", sub: 0}, | |
{number: 5, numeral: "V", sub: -1}, | |
{number: 10, numeral: "X", sub: -2}, | |
{number: 50, numeral: "L", sub: -1}, | |
{number: 100, numeral: "C", sub: -2}, | |
{number: 500, numeral: "D", sub: -1}, | |
{number: 1000, numeral: "M", sub: -2} | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Example of multiple indexers within a single class. | |
/// | |
/// Why you might want/need to do this, who knows? | |
/// </summary> | |
namespace CSharp_Examples { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
/// <summary> | |
/// Example of multiple enumerators within a class so that you can enumerate through values | |
/// hosted by the class in different ways. In this example, one enumerator allows you to go |