Search
 
SCRIPT & CODE EXAMPLE
 

C

c distance in the cartesian plane

#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 :: terminal count files in directory 
C :: plt hide axis ticks 
C :: arduino wifi ip address to string 
C :: pygame detect click 
C :: Animated sprite from few images pygame 
C :: how to make a hello world program in c 
C :: transpose of matrix using c program 
C :: disable lua errors 
C :: same project on different monitor in intellij mac 
C :: rl_replace_line 
C :: prime check in c 
C :: remove from string c 
C :: arduino client disconnect 
C :: cannot get / react router dom 
C :: clrscr in c 
C :: if statement c short form 
C :: divide and conquer program in c 
C :: scanf string in c 
C :: sequelize count multiple associations 
C :: multiplication table in c using array 
C :: c print to stderr 
C :: c get current month, year, day 
C :: #define arduino 
C :: How to Convert double to int in C 
C :: flip exis in dataframe 
C :: c bubble sort 
C :: set the nth bit 
C :: pygramid program in c 
C :: esp8266 wifi.config does not work 
C :: algorithm for dequeue 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =