home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / softsys / matlab / 125 < prev    next >
Encoding:
Text File  |  1993-01-24  |  2.1 KB  |  39 lines

  1. Path: sparky!uunet!news.univie.ac.at!blekul11!frmop11!dearn!esoc!estec!pmortens
  2. Organisation: European Space Technology Centre (E.S.T.E.C)
  3. Date: Saturday, 23 Jan 1993 19:07:44 CET
  4. From: <PMORTENS@ESTEC.BITNET>
  5. Message-ID: <93023.190744PMORTENS@ESTEC.BITNET>
  6. Newsgroups: comp.soft-sys.matlab
  7. Subject:    SOURCE: vector cross product
  8. Lines: 29
  9.  
  10. .gf cross1 m
  11. Maybe this is trivial but here it is: a function returning the cross
  12. product of two vectors.
  13.  
  14.  
  15. function c=CROSS(a,b);
  16. %****************************************************************************
  17. %* FORMAT  : c=CROSS(a,b);                                                  *
  18. %* This function returns the crossproduct of a and b. The returned vector   *
  19. %* is a column vector                                                       *
  20. %****************************************************************************
  21.  
  22. %****************************************************************************
  23. %*         European Space Research and Technology Centre (ESTEC)            *
  24. %*        Earth Observation Preparatory Programme Division (EOPP)           *
  25. %*                         Solid Earth Section (OPS)                        *
  26. %*                          Peter Mortensen                                 *
  27. %*                                                                          *
  28. %*    Programme for optimal signal estimation, ARISTOTELES.                 *
  29. %*    File: CROSS.M   VRS: 1.0                                              *
  30. %*                                                                          *
  31. %* CREATED : PM 24.04.1992                                                  *
  32. %* UPDATED :                                                                *
  33. %*                                                                          *
  34. %* This function returns the crossproduct of its 2 argument vectors         *
  35. %* M-files in use: None                                                     *
  36. %****************************************************************************
  37. c=[ a(2)*b(3)-b(2)*a(3) ; -a(1)*b(3)+b(1)*a(3) ; a(1)*b(2)-b(1)*a(2) ];
  38.  
  39.