You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ios/functions.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,13 +95,6 @@ max 2 4 // returns 4
95
95
max 50-5.1// returns 5
96
96
```
97
97
98
-
The `sum` function returns the sum of two or more values:
99
-
100
-
```swift
101
-
sum 24// returns 6
102
-
sum 50-5.1// returns -0.1
103
-
```
104
-
105
98
## Linear Algebra
106
99
107
100
ShapeScript also includes functions for operating on [vectors](literals.md#vectors-and-tuples):
@@ -136,6 +129,14 @@ define v (3 4)
136
129
print normalize(v) // returns 0.6 0.8
137
130
```
138
131
132
+
The `sum` function returns the sum of two or more values. It works with both scalar and vector inputs:
133
+
134
+
```swift
135
+
sum 24// returns 6
136
+
sum 50-5.1// returns -0.1
137
+
sum (123) (456) // returns (5 7 9)
138
+
```
139
+
139
140
## Trigonometry
140
141
141
142
For the most part, you can avoid the need for trigonometry in ShapeScript by using the built-in [transform commands](transforms.md#relative-transforms) to manipulate geometry rather than manually calculating the positions of vertices.
Copy file name to clipboardExpand all lines: docs/mac/functions.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,13 +95,6 @@ max 2 4 // returns 4
95
95
max 50-5.1// returns 5
96
96
```
97
97
98
-
The `sum` function returns the sum of two or more values:
99
-
100
-
```swift
101
-
sum 24// returns 6
102
-
sum 50-5.1// returns -0.1
103
-
```
104
-
105
98
## Linear Algebra
106
99
107
100
ShapeScript also includes functions for operating on [vectors](literals.md#vectors-and-tuples):
@@ -136,6 +129,14 @@ define v (3 4)
136
129
print normalize(v) // returns 0.6 0.8
137
130
```
138
131
132
+
The `sum` function returns the sum of two or more values. It works with both scalar and vector inputs:
133
+
134
+
```swift
135
+
sum 24// returns 6
136
+
sum 50-5.1// returns -0.1
137
+
sum (123) (456) // returns (5 7 9)
138
+
```
139
+
139
140
## Trigonometry
140
141
141
142
For the most part, you can avoid the need for trigonometry in ShapeScript by using the built-in [transform commands](transforms.md#relative-transforms) to manipulate geometry rather than manually calculating the positions of vertices.
Copy file name to clipboardExpand all lines: docs/src/functions.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,13 +95,6 @@ max 2 4 // returns 4
95
95
max 50-5.1// returns 5
96
96
```
97
97
98
-
The `sum` function returns the sum of two or more values:
99
-
100
-
```swift
101
-
sum 24// returns 6
102
-
sum 50-5.1// returns -0.1
103
-
```
104
-
105
98
## Linear Algebra
106
99
107
100
ShapeScript also includes functions for operating on [vectors](literals.md#vectors-and-tuples):
@@ -136,6 +129,14 @@ define v (3 4)
136
129
print normalize(v) // returns 0.6 0.8
137
130
```
138
131
132
+
The `sum` function returns the sum of two or more values. It works with both scalar and vector inputs:
133
+
134
+
```swift
135
+
sum 24// returns 6
136
+
sum 50-5.1// returns -0.1
137
+
sum (123) (456) // returns (5 7 9)
138
+
```
139
+
139
140
## Trigonometry
140
141
141
142
For the most part, you can avoid the need for trigonometry in ShapeScript by using the built-in [transform commands](transforms.md#relative-transforms) to manipulate geometry rather than manually calculating the positions of vertices.
0 commit comments