Skip to content

Commit

Permalink
Migrate type(..) comparison to the new way
Browse files Browse the repository at this point in the history
  • Loading branch information
Leedehai committed Dec 30, 2023
1 parent bbde9ff commit fcf3a5e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions physica.typ
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
#let identitymatrix(order, delim:"(", fill:none) = {
let order_num = if type(order) == content and __content_holds_number(order) {
int(order.text)
} else if type(order) == "integer" {
} else if type(order) == int {
order
} else {
panic("imat/identitymatrix: the order shall be an integer, e.g. 2")
Expand All @@ -317,7 +317,7 @@
#let zeromatrix(order, delim:"(") = {
let order_num = if type(order) == content and __content_holds_number(order) {
int(order.text)
} else if type(order) == "integer" {
} else if type(order) == int {
order
} else {
panic("zmat/zeromatrix: the order shall be an integer, e.g. 2")
Expand Down Expand Up @@ -365,15 +365,15 @@
#let xmatrix(m, n, func, delim:"(") = {
let rows = if type(m) == content and __content_holds_number(m) {
int(m.text)
} else if type(m) == "integer" {
} else if type(m) == int {
m
} else {
panic("xmat/xmatrix: the first argument shall be an integer, e.g. 2")
}

let cols = if type(n) == content and __content_holds_number(m) {
int(n.text)
} else if type(n) == "integer" {
} else if type(n) == int {
n
} else {
panic("xmat/xmatrix: the second argument shall be an integer, e.g. 2")
Expand All @@ -396,15 +396,15 @@
#let xmat = xmatrix

#let rot2mat(theta, delim:"(") = {
let operand = if type(theta) == "content" and __is_add_sub_sequence(theta) {
let operand = if type(theta) == content and __is_add_sub_sequence(theta) {
$(theta)$
} else { theta }
$mat(cos operand, -sin operand;
sin operand, cos operand; delim: delim)$
}

#let rot3xmat(theta, delim:"(") = {
let operand = if type(theta) == "content" and __is_add_sub_sequence(theta) {
let operand = if type(theta) == content and __is_add_sub_sequence(theta) {
$(theta)$
} else { theta }
$mat(1, 0, 0;
Expand All @@ -413,7 +413,7 @@
}

#let rot3ymat(theta, delim:"(") = {
let operand = if type(theta) == "content" and __is_add_sub_sequence(theta) {
let operand = if type(theta) == content and __is_add_sub_sequence(theta) {
$(theta)$
} else { theta }
$mat(cos operand, 0, sin operand;
Expand All @@ -422,7 +422,7 @@
}

#let rot3zmat(theta, delim:"(") = {
let operand = if type(theta) == "content" and __is_add_sub_sequence(theta) {
let operand = if type(theta) == content and __is_add_sub_sequence(theta) {
$(theta)$
} else { theta }
$mat(cos operand, -sin operand, 0;
Expand Down

0 comments on commit fcf3a5e

Please sign in to comment.