Search
 
SCRIPT & CODE EXAMPLE
 

C

calculate distance between 2 points X Y axis

#include <stdio.h>
#include <math.h>
	//math.h library for square root and power functions
	//uses pythagorean theorem to calculate distance

float Distance(float x1, float y1, float x2, float y2)
{
    return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}
Comment

PREVIOUS NEXT
Code Example
C :: rename c 
C :: purge nvidia 
C :: boolean in c 
C :: manifest orientation portrait 
C :: factorial c program using for loop 
C :: classification report to excel 
C :: arma 3 get group size 
C :: how to map one value to another in C 
C :: how to print boolean in c 
C :: tainted love 
C :: find power of a number in c 
C :: is 33 prime number 
C :: arduino digital input pins 
C :: multiplication of two matrix in c 
C :: c Program for Sum of the digits of a given number 
C :: c bit access struct 
C :: how to empty string in c 
C :: get range of values in mongodb 
C :: c print char 
C :: function for calculate the average and standard deviation of table 
C :: int_min in c 
C :: ruby find object in array by attribute 
C :: epoch time in c 
C :: Example of Implementation of a pointer to an array in C: 
C :: typedef vs #define 
C :: c bits 
C :: continue statement in c 
C :: debian unhold packages 
C :: increment and decrement operator 
C :: C Program to Check Whether Character is Lowercase or Not using islower function 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =