hi there i just wanted to know if there was a way doing the following mathematical equation more easily.
static float distanceToBuilding(TravellerSprite travellersprite, BuildingSprite buildingsprite)
{
float f = (float)buildingsprite.xcoord - travellersprite.xcoord;
float f1 = (float)buildingsprite.ycoord - travellersprite.ycoord;
return (float)Math.sqrt(f * f + f1 * f1);
}
thanx. hbutt
static float distanceToBuilding(TravellerSprite travellersprite, BuildingSprite buildingsprite)
{
float f = (float)buildingsprite.xcoord - travellersprite.xcoord;
float f1 = (float)buildingsprite.ycoord - travellersprite.ycoord;
return (float)Math.sqrt(f * f + f1 * f1);
}
thanx. hbutt