#import "@preview/cetz:0.3.1": canvas, draw
#import "blobs.typ": draw-blob

#set page(width: auto, height: auto, margin: 1cm)

#canvas({
  draw-blob(
    2, (0, 0), 1.5,
    stroke: green,
    name: "blob1"
  )

  draw-blob(
    8, (5, 0), 1.5,
    n-pts: 10,
    stroke: orange,
    name: "blob2"
  )

  draw.circle(
    "blob1.center",
    radius: .05,
    fill: black,
    stroke: none,
    name: "x"
  )

  draw.circle(
    "blob2.center",
    radius: .05,
    fill: black,
    stroke: none,
    name: "y"
  )

  draw.content(
    "x",
    [$arrow(x)$],
    anchor: "east",
    padding: 3pt
  )

  draw.content(
    "y",
    [$arrow(y)$],
    anchor: "west",
    padding: 3pt
  )

  draw.content(
    (-1.2, .8),
    text(fill: green)[$RR^n$]
  )

  draw.content(
    (4.6, 1.4),
    text(fill: orange)[$RR^m$]
  )

  let mid = (2.5, .5)

  draw.bezier-through(
    "x.north-east", mid, "y.north-west",
    stroke: blue + .5pt,
    mark: (end: ">", fill: blue),
    name: "arrow"
  )
  draw.content(
    mid,
    [$f$],
    anchor: "south",
    padding: 3pt
  )

  draw.content(
    (2.5, -1),
    text(fill: blue)[$f: RR^n -> RR^m$]
  )
})