Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "affichage.h"
- #include <stdio.h>
- #include <math.h>
- void printf_Point2D (Point2D p)
- {
- printf ("Point 2D :\n");
- printf (" - abscisse : (%.3f)\n", p.x);
- printf (" - ordonnée : (%.3f)\n", p.y);
- printf ("\n");
- }
- void printf_Segment2D (Segment2D s)
- {
- printf ("Segment 2D :\n");
- printf (" - Point de depart : (%.3f , %.3f)\n", s.depart.x, s.depart.y);
- printf (" - Point d'arrivee : (%.3f , %.3f)\n", s.arrive.x, s.arrive.y);
- printf ("\n");
- }
- void printf_Rectangle2D (Rectangle2D dimension, Point2D point_A, Point2D point_B,Point2D point_C)
- {
- double calculParentheses = pow((point_C.x - point_B.y),2) + pow((point_C.y - point_B.y),2);
- dimension.segment_rectangle = sqrt(calculParentheses);
- double resultat_dimension = dimension.segment_rectangle;
- printf ("Rectangle 2D :\n");
- printf (" - point A : (%.3f , %.3f)\n", point_A.x, point_A.y);
- printf (" - point B : (%.3f , %.3f)\n", point_B.x, point_B.y);
- printf (" - point C : (%.3f , %.3f)\n", point_C.x, point_C.y);
- printf (" - dimension : (%.3f)\n", resultat_dimension);
- printf ("\n");
- }
- void printf_Cercle2D (Cercle2D Cercle)
- {
- double rayon = sqrt(pow((Cercle.rayon.depart.x - Cercle.rayon.arrive.y),2) + pow((Cercle.rayon.depart.y - Cercle.rayon.arrive.y),2));
- printf ("Cercle 2D :\n");
- printf (" - centre : (%.3f , %.3f)\n", Cercle.centre.x , Cercle.centre.y);
- printf (" - rayon : (%.3f)\n)", rayon);
- printf ("\n");
- }
- void printf_ArcDeCercle2D (ArcDeCercle2D ArcDeCercle)
- {
- double rayon = sqrt(pow((ArcDeCercle.rayon.depart.x - ArcDeCercle.rayon.arrive.y),2) + pow((ArcDeCercle.rayon.depart.y - ArcDeCercle.rayon.arrive.y),2));
- printf ("Arc De Cercle 2D : \n");
- printf (" - centre : (%.3f , %.3f)\n", ArcDeCercle.centre.x , ArcDeCercle.centre.y);
- printf (" - rayon : (%.3f)\n", rayon);
- printf (" - Angle de Depart : (%.3f)\n", ArcDeCercle.angle_depart);
- printf (" - Angle de fin : (%.3f)\n", ArcDeCercle.angle_fin);
- printf ("\n");
- }
Add Comment
Please, Sign In to add comment