Browse Source

Added source files

master
Rainer Hihn 3 years ago
parent
commit
075e40cb8f
2 changed files with 56 additions and 0 deletions
  1. +30
    -0
      strecke.c
  2. +26
    -0
      strecke.h

+ 30
- 0
strecke.c View File

@@ -0,0 +1,30 @@
/***********************
* Laenge einer Strecke im Raum
*
* Rainer Hihn
*/

#include "strecke.h"

int main(void)
{
/**
* Variablendeklaration
*/
struct point firstPoint;
struct point secondPoint;
struct point thirdPoint;

printf("Entfernung berechnen \n");

/**
* einlesen der 3 Punkte
*/
firstPoint = readPoint();
secondPoint = readPoint();
thirdPoint = readPoint();

printf("Die Flaeche des Dreiecks betraegt %f \n", areaTrinagle(firstPoint, secondPoint, thirdPoint));

return 0;
}

+ 26
- 0
strecke.h View File

@@ -0,0 +1,26 @@
/**
* Headerdatei fuer Palindrom
* Funktiondeklarierung
*
* Rainer Hihn
*/

#include <stdio.h>
#include <math.h>

/*
* functions
*/
struct point readPoint();
float distance(struct point point1, struct point point2);
float areaTrinagle(struct point point1, struct point point2, struct point point3);

/*
* structs
*/
struct point
{
float rX;
float rY;
float rZ;
};

Loading…
Cancel
Save