SwiftUI 中 Path.addArc 的顺时针方向错了吗?

Is clockwise of Path.addArc in SwiftUI wrong?

以下来自苹果官方文档:

This method creates an open subpath. The created arc lies on the perimeter of the specified circle. When drawn in the default coordinate system, the start and end angles are based on the unit circle shown in Figure 1. For example, specifying a start angle of 0 radians, an end angle of π radians, and setting the clockwise parameter to true draws the bottom half of the circle. However, specifying the same start and end angles but setting the clockwise parameter set to false draws the top half of the circle.

但我发现结果似乎恰恰相反。下面是我的代码

var body: some View {
    Path { path in
        path.addArc(center: CGPoint(x: 200, y: 370), radius: 50, startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 180.0), clockwise: true)
        path.closeSubpath()
    }
}

我将顺时针参数设置为true但结果是圆的上半部分,而不是下半部分

我是不是理解错了苹果的文档?我的 Xcode 版本是 11.0 beta 4 (11M374r)

clockwise 参数的含义存在于一个量子叠加态中,当您检查结果时该叠加态会坍缩。不幸的是,它总是崩溃到与你想要的相反的意思。

更严重的是,Apple 的文档中存在一些缺陷:

  • “默认坐标系”实际上是指标准笛卡尔坐标系,其中y轴向canvas的顶部增加。但是 SwiftUI 和 UIKit 总是设置 y 轴“翻转”的坐标系,以便 y 值向 canvas.

    的底部增加
  • clockwise 仅在标准笛卡尔坐标系中准确。它 really 的意思是“从正 y 轴到正 x 轴的旋转方向”。因此,当您在翻转坐标系中工作时,clockwise 表示相反的方向!

下图可能会阐明我的意思。上图显示了一个标准的笛卡尔坐标系,其中从正 y 轴到正 x 轴的旋转方向确实是顺时针方向。下图显示了一个翻转的坐标系,这是SwiftUI和UIKit提供的,从正y轴到正x轴的旋转方向实际上是逆时针的,但API称之为“顺时针”。