Anyone has shiny code or R code about how to calculate the intersection area of two circles?
ui
library(shiny)
Define UI for application that draws a histogram
shinyUI(fluidPage(
# Application title titlePanel("Choose your probability"),
# Sidebar with a slider input for number of bins sidebarLayout( sidebarPanel(
sliderInput("radius",
"Probability of A",
min = 0,
max = 0.4,
value = 0.2),
sliderInput("radius2",
"Probability of B",
min = 0,
max = 0.4,
value = 0.2)
),
mainPanel(
plotOutput("distPlot")
)
) ))
server
library(shiny) library(plotrix) library(grid)
Define server logic required to draw a histogram
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
isolate({
plot(c(-1,1),c(-1,1), type = 'n')
})
draw.circle(-0.25,0,input$radius)
draw.circle(0.25,0,input$radius2)
})
})