logic {matRiks}R Documentation

Logical rules (Method)

Description

Apply logical rules (intersection–AND, union–OR, symmetrical difference–XOR) to a concatenation of figures

Usage

logic(fig, n, rule, seed, ...)

## S3 method for class 'figure'
logic(fig, n = 1, rule = "logic", seed = 1, ...)

Arguments

fig

Vector of figures obtained with the concatenation of figures function ('cof()'). Three figures are needed.

n

integer, defines the elements of the logical expression. n=1 and n=2 are the concatenations of figures to which the logical operation is applied. n=3 is the result of the operation.

rule

character, logic rule to be applied, either 'AND', 'OR', 'XOR'

seed

integer, Set the random seed so that the permutations are consistent

...

Other arguments

Value

An object that is the logical combination of the figures

An object that is the logical combination of the figures

Methods (by class)

Examples

draw(logic(cof(square(), malta(), circle()), "AND"))

draw(logic(cof(square(), malta(), circle()), "AND"))


[Package matRiks version 0.1.3 Index]