# bool2x2

> A 2x2 matrix of bools.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Mathematics](/engine/6000.6/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule
* **Implements:** [IEquatable\<bool2x2>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public struct bool2x2 : IEquatable<bool2x2>
```

## Fields

| Value                                                                 | Description             |
| --------------------------------------------------------------------- | ----------------------- |
| [c0](/engine/6000.6/script-reference/unity/mathematics/bool2x2/c0.md) | Column 0 of the matrix. |
| [c1](/engine/6000.6/script-reference/unity/mathematics/bool2x2/c1.md) | Column 1 of the matrix. |

## Constructors

| Constructor                                                                                                                                                              | Description                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
| [bool2x2(System.Boolean)](/engine/6000.6/script-reference/unity/mathematics/bool2x2/ctor.md#bool2x2\(bool\))                                                             | Constructs a bool2x2 matrix from a single bool value by assigning it to every component. |
| [bool2x2(System.Boolean,System.Boolean,System.Boolean,System.Boolean)](/engine/6000.6/script-reference/unity/mathematics/bool2x2/ctor.md#bool2x2\(bool-bool-bool-bool\)) | Constructs a bool2x2 matrix from 4 bool values given in row-major order.                 |
| [bool2x2(Unity.Mathematics.bool2,Unity.Mathematics.bool2)](/engine/6000.6/script-reference/unity/mathematics/bool2x2/ctor.md#bool2x2\(bool2-bool2\))                     | Constructs a bool2x2 matrix from two bool2 vectors.                                      |

## Properties

| Property                                                                      | Description                                     |
| ----------------------------------------------------------------------------- | ----------------------------------------------- |
| [this\[\]](/engine/6000.6/script-reference/unity/mathematics/bool2x2/item.md) | Returns the bool2 element at a specified index. |

## Methods

| Method                                                                                  | Description                                                               |
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [Equals](/engine/6000.6/script-reference/unity/mathematics/bool2x2/equals.md)           | Returns true if the bool2x2 is equal to a given bool2x2, false otherwise. |
| [GetHashCode](/engine/6000.6/script-reference/unity/mathematics/bool2x2/gethashcode.md) | Returns a hash code for the bool2x2.                                      |
| [ToString](/engine/6000.6/script-reference/unity/mathematics/bool2x2/tostring.md)       | Returns a string representation of the bool2x2.                           |

## Operators

| Operator                                                                                  | Description                                                                                                |
| ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [operator &](/engine/6000.6/script-reference/unity/mathematics/bool2x2/op-bitwiseand.md)  | Returns the result of a componentwise bitwise and operation on a bool value and a bool2x2 matrix.          |
| [operator \|](/engine/6000.6/script-reference/unity/mathematics/bool2x2/op-bitwiseor.md)  | Returns the result of a componentwise bitwise or operation on a bool value and a bool2x2 matrix.           |
| [operator ==](/engine/6000.6/script-reference/unity/mathematics/bool2x2/op-equality.md)   | Returns the result of a componentwise equality operation on a bool value and a bool2x2 matrix.             |
| [operator ^](/engine/6000.6/script-reference/unity/mathematics/bool2x2/op-exclusiveor.md) | Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2x2 matrix. |
| [bool2x2](/engine/6000.6/script-reference/unity/mathematics/bool2x2/op-implicit.md)       | Implicitly converts a single bool value to a bool2x2 matrix by assigning it to every component.            |
| [operator !=](/engine/6000.6/script-reference/unity/mathematics/bool2x2/op-inequality.md) | Returns the result of a componentwise not equal operation on a bool value and a bool2x2 matrix.            |
| [operator !](/engine/6000.6/script-reference/unity/mathematics/bool2x2/op-logicalnot.md)  | Returns the result of a componentwise not operation on a bool2x2 matrix.                                   |
