VPPS-SS14-W05-1-Pseudogley




dreieck.1 <- function(orientation, declination, c) {
    rad <- orientation * pi/180 + declination * pi/180
    geka <- sin(rad) * c
    anka <- cos(rad) * c

    wert <- list(y = round(geka, 2), x = round(anka, 2))
    return(wert)
}
dreieck.1(9, 1.85, 48)
## $y
## [1] 9.04
## 
## $x
## [1] 47.14

dreieck.2 <- function(orientation, declination, c) {
    rad <- orientation * pi/180 + declination * pi/180
    geka <- sin(rad) * c
    anka <- cos(rad) * c

    wert <- list(x = round(geka, 2), y = round(anka, 2))
    return(wert)
}
dreieck.2(9, 1.85, 30)
## $x
## [1] 5.65
## 
## $y
## [1] 29.46

cornerA <- function(x.known, y.known, size.x, size.y) {
    Ax <- x.known - size.x
    Ay <- y.known + size.y
    wert <- list(x = round(Ax, 2), y = round(Ay, 2))
    return(wert)
}
cornerA(481054, 5645540, 47.41, 7.51)
## $x
## [1] 481007
## 
## $y
## [1] 5645548

cornerC <- function(x.known, y.known, size.x, size.y) {
    Ax <- x.known + size.x
    Ay <- y.known + size.y
    wert <- list(x = round(Ax, 2), y = round(Ay, 2))
    return(wert)
}
cornerC(481054, 5645540, 5.65, 29.46)
## $x
## [1] 481060
## 
## $y
## [1] 5645569

cornerB <- function(x.known, y.known, size.x, size.y) {
    Ax <- x.known + size.x
    Ay <- y.known + size.y
    wert <- list(x = round(Ax, 2), y = round(Ay, 2))
    return(wert)
}
cornerB(481006.6, 5645548, 5.65, 29.46)
## $x
## [1] 481012
## 
## $y
## [1] 5645577

One thought on “VPPS-SS14-W05-1-Pseudogley

  1. Tim Appelhans

    Hello,
    this is all a bit messy. Please try to write one function (making use of the functions you’ve written already) as defined in W05-1: Data cleaning and GitHub. Also, please stick to Google’s R style guide (i.e. use spaces where appropriate) to ensure readability of the code.

    Cheers
    Tim

Leave a Reply