From 6299c8927f274b0de295cc8a037c6022dd71aa0d Mon Sep 17 00:00:00 2001 From: francois Date: Sun, 6 Jul 2014 12:06:54 -0400 Subject: [PATCH] =?UTF-8?q?D=C3=A9placer=20le=20code=20et=20cr=C3=A9er=20u?= =?UTF-8?q?n=20projet=20Eclipse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .project | 24 ++++++++++++++++++++++ .settings/org.eclipse.core.resources.prefs | 2 ++ cooperators.Rnw | 19 +---------------- ellipse.R | 17 +++++++++++++++ 4 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 .project create mode 100644 .settings/org.eclipse.core.resources.prefs 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 +}