solve_2set: Area-proportional 2-set circle layout

View source: R/proportional.R

solve_2setR Documentation

Area-proportional 2-set circle layout

Description

Solves for two circles whose areas equal 'a_only + ab' and 'b_only + ab' and whose intersection area equals 'ab', by analytical bisection on the inter-center distance. Always exact (returns 'is_approximate = FALSE').

Usage

solve_2set(a_only, b_only, ab)

Arguments

a_only

Items in A only (integer >= 0).

b_only

Items in B only (integer >= 0).

ab

Items in A intersection B (integer >= 0).

Details

Mirrors Python 'solve_2set' byte-for-byte.

Value

A named list with elements:

circles

Length-2 list of 'list(cx, cy, r)' named lists.

error

Relative error of the achieved area fit (typically < 1e-4).

is_approximate

Always 'FALSE' for 2-set.

Examples

solve_2set(a_only = 30L, b_only = 30L, ab = 10L)

vennDiagramLab documentation built on May 19, 2026, 1:07 a.m.