Aller au contenu

Mathc matrices/08t

Un livre de Wikilivres.


Application

Installer et compiler ces fichiers dans votre répertoire de travail.

c00d.c
/* ------------------------------------ */
/*  Save as :   c00d.c                  */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */     
#define RCA          RC2  
/* ------------------------------------ */       
/* ------------------------------------ */
int main(void)
{                          
double a[RCA*RCA] ={   
+1.142857142857, +0.571428571428, 
-0.285714285714, -0.142857142857        
};

double P[RCA*C1] ={   
+3,
+1
};
                       
double **A  =  ca_A_mR(a, i_mR(RCA,RCA));
double **p  =  ca_A_mR(P, i_mR(RCA,C1));
double **Pp =             i_mR(RCA,C1);

  clrscrn();
  printf(" A :");
  p_mR(A, S9,P12, C4); 
  
  printf(" p: A point of the plan");
  p_mR(p, S9,P12, C4); 
 
  printf(" Pp: The projection of p on the line");
  mul_mR(A,p,Pp);
  p_mR(Pp, S9,P12, C4);      
  stop();
 
  f_mR(A);
  f_mR(p);
  f_mR(Pp);
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
 Vous pouvez calculer la projection d'un point P sur la droite. Vous pouvez tracer un repère cartésien pour vérifier le résultat pour P(-5,3), P(3,1) et P(-1,2).

Exemple de sortie écran :

 A :
+1.142857142857 +0.571428571428 
-0.285714285714 -0.142857142857 

 p: A point of the plan
     -5.0 
     +3.0 

 Pp: The projection of p on the line
     -4.0 
     +1.0 

 Press return to continue.