diff --git a/.project b/.project new file mode 100644 index 0000000..ccf4bd0 --- /dev/null +++ b/.project @@ -0,0 +1,24 @@ + + + SolutionCooperators + + + + + + de.walware.docmlet.tex.builders.Tex + + + + + de.walware.statet.r.builders.RSupport + + + + + + de.walware.statet.base.StatetNature + de.walware.statet.r.RNature + de.walware.docmlet.tex.natures.Tex + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..85a5a44 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/cooperators.Rnw=UTF-8 diff --git a/cooperators.Rnw b/cooperators.Rnw index 15803d0..5673d46 100644 --- a/cooperators.Rnw +++ b/cooperators.Rnw @@ -88,24 +88,7 @@ représentant les orages, et de déterminer si des assurés sont touchés par le orages. Les functions suivantes seront utilisées à cette fin: <>= -ellipse_param <- function(t,X,Y,a,b,phi) -{ - cbind(X + a * cos(t)*cos(phi) - b*sin(t)*sin(phi),Y + a * - cos(t)*sin(phi) + b*sin(t)*cos(phi)) -} - -dans_ellipse_param <- function(coord,param) -{ - x <- coord[,1] - y <- coord[,2] - xc <- param[1] - yc <- param[2] - a <- param[3] - b <- param[4] - phi <- param[5] - (((x-xc)*cos(phi)-(y-yc)*sin(phi))^2/a^2 + - ((x-xc)*sin(phi)+(y-yc)*cos(phi))^2/b^2) <= 1 -} +source("ellipse.r") @ \subsection{Importation des données} diff --git a/ellipse.R b/ellipse.R index 67f6e1a..d3244f8 100644 --- a/ellipse.R +++ b/ellipse.R @@ -3,4 +3,21 @@ # Author: francois ############################################################################### +ellipse_param <- function(t,X,Y,a,b,phi) +{ + cbind(X + a * cos(t)*cos(phi) - b*sin(t)*sin(phi),Y + a * + cos(t)*sin(phi) + b*sin(t)*cos(phi)) +} +dans_ellipse_param <- function(coord,param) +{ + x <- coord[,1] + y <- coord[,2] + xc <- param[1] + yc <- param[2] + a <- param[3] + b <- param[4] + phi <- param[5] + (((x-xc)*cos(phi)-(y-yc)*sin(phi))^2/a^2 + + ((x-xc)*sin(phi)+(y-yc)*cos(phi))^2/b^2) <= 1 +}