(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(*   par Marcel D\[EAcute]l\[EGrave]ze   *)


BeginPackage["Objets3D`"]


vecteur3D::usage=
	"vecteur3D[r, v, t, e] repr\[EAcute]sente le vecteur v avec\nle point d'application est r\nla longueur de t\[EHat]te t par rapport \[AGrave] la norme du vecteur (typiquement t=0.1)\nl'\[EAcute]paisseur de la fl\[EGrave]che e (typiquement e=0.005."


Begin["`Private`"]


vecteur3D[r_List, v_List,t_,e_]:=Module[{n=16,i,j,s},
		i=Which[Abs[v[[1]]]<=Abs[v[[2]]]\[And]Abs[v[[1]]]<=Abs[v[[3]]],{0,-v[[3]],v[[2]]},
				Abs[v[[2]]]<=Abs[v[[1]]]\[And]Abs[v[[2]]]<=Abs[v[[3]]],	{-v[[3]],0,v[[1]]},
				True,{-v[[2]],v[[1]],0}];
		i=(t*Sqrt[v.v])/4 i/Sqrt[i.i];
		j=v\[Cross]i; j=(t*Sqrt[v.v])/4 j/Sqrt[j.j];
		s=r+v; m=r+(1-t) v;
		{{Thickness[e],Line[{r,m}]},
			Table[Line[{s, m+i Cos[(k 2 \[Pi])/n]+j Sin[(k 2 \[Pi])/n]}],{k,0,n-1}],
		Line[Table[ m+i Cos[(k 2 \[Pi])/n]+j Sin[(k 2 \[Pi])/n],{k,0,n}]]}]


End[]


EndPackage[]
