static void Main() { Point3D myPoint = new Point3D(1, 2, 3); Console.WriteLine("The ToString() overload: {0}", myPoint); Console.WriteLine(); Console.WriteLine("The static point 0: {0}", Point3D.CentrePoint); Console.WriteLine(); Point3D myOtherPoint = new Point3D(3, 2, 1); double pointsDistance = CalculateDistance.Distance(myPoint, myOtherPoint); Console.WriteLine("Calculated distance: {0}", pointsDistance); Console.WriteLine(); Path route = new Path(); route.AddPoint(Point3D.CentrePoint); route.AddPoint(myPoint); route.AddPoint(myOtherPoint); route.AddPoint(new Point3D(1.1, 2.2, 3.82743658793465)); Console.WriteLine("One of the points in the path: {0}", route.PointsPath[1]); Console.WriteLine(); PathStorage.SavePath(route, "../../test.txt"); Path loadedRoute = PathStorage.LoadPath("../../test.txt"); Console.WriteLine("Print path loaded from file"); foreach (var point in loadedRoute.PointsPath) { Console.WriteLine(point); } }
//private ShipManager shipManager; private void Start() { calculateDistance = GetComponent <CalculateDistance>(); currentCapacity = startingCapacity; currentFuel = currentCapacity; //shipManager = GetComponent<ShipManager>(); upgradeManager = GetComponent <UpgradeManager>(); }
private void Start() { calculateDistance = FindObjectOfType <CalculateDistance>(); timers = new float[spawnableEnemies.Length]; for (int i = 0; i < timers.Length; i++) { timers[i] = 0.0f; } }
private void Awake() { if (calculateDistance == null) { calculateDistance = FindObjectOfType <CalculateDistance>(); } scanRubbish = GetComponent <ScanRubbish>(); fillerImage = GetComponent <Image>(); playerDataSaver = GetComponent <PlayerDataSaver>(); }
private void OnEnable() { if (Instance != null && Instance != this) { Destroy(this.gameObject); } else { Instance = this; } }
// Start is called before the first frame update void Start() { calculateDistance = FindObjectOfType <CalculateDistance>(); Material skyboxMatCopy = new Material(RenderSettings.skybox); RenderSettings.skybox = skyboxMatCopy; RenderSettings.skybox.SetColor("_colorTop", skyboxThresholds[0].topColor); RenderSettings.skybox.SetColor("_colorBottom", skyboxThresholds[0].bottomColor); RenderSettings.skybox.SetFloat("_gradientHeight", skyboxThresholds[0].height); }
// Returns if the event is within an area private static bool EventDistance(double lat, double lon, double[] cords) { return(CalculateDistance.Calculate(new Location { Latitude = lat, Longitude = lon }, new Location { Latitude = cords[0], Longitude = cords[1] }) < cords[2]); }
internal async Task <IEnumerable <RestaurantSummaryEntity> > Search(FilterDefinition <RestaurantEntity> searchFilter, int start, int limit, Point usersLocation) { var Collection = context.Database.GetCollection <RestaurantEntity>(MongoCollectionNames.RestaurantsCollectionName); var searchResult = await Collection.Find(searchFilter).Skip(start).Limit(limit).ToListAsync(); var list = new List <RestaurantSummaryEntity>(); foreach (var item in searchResult) { item.IsOpenNow = OpenOrCloseDetector.Detect(item); item.Distance = CalculateDistance.distance(usersLocation, item.GeoPoint); var result = new RestaurantSummaryEntity(item); list.Add(result); } return(list); }
private void Start() { calculateDistance = FindObjectOfType <CalculateDistance>(); startingYPos = transform.position.y; }
public void TestCalculateDistanceMethodWithExpectation() { CalculateDistance c = new CalculateDistance(); Assert.IsTrue(Math.Abs(c.Calculate(52.986375, -6.043701, 53.3381985, -6.2592576) - 41.62) < 0.5); }
public static double CalcDiagonalYZ() { double distance = CalculateDistance.CalcDistance2D(0, 0, Height, Depth); return distance; }
public static double CalcDiagonalXZ() { double distance = CalculateDistance.CalcDistance2D(0, 0, Width, Depth); return distance; }
public static double CalcDiagonalXY() { double distance = CalculateDistance.CalcDistance2D(0, 0, Width, Height); return distance; }
private void Start() { calculateDistance = FindObjectOfType <CalculateDistance>(); ps = GetComponent <ParticleSystem>(); em = ps.emission; }
public void Create(T[] newItems, CalculateDistance <T> distanceCalculator) { this.items = newItems; this.calculateDistance = distanceCalculator; this.root = this.BuildFromPoints(0, newItems.Length); }
public void TestCalculateDistanceMethodWithSameTwoLocations() { CalculateDistance c = new CalculateDistance(); Assert.IsTrue(c.Calculate(53.3381985, -6.2592576, 53.3381985, -6.2592576) == 0); }