# C1.Util.DX.Vector4.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Vector4__ctor_" data-uid="C1.Util.DX.Vector4.#ctor*">Vector4 Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Vector4__ctor_" data-uid="C1.Util.DX.Vector4.#ctor*"></a>
<h4 id="C1_Util_DX_Vector4__ctor_System_Single_" data-uid="C1.Util.DX.Vector4.#ctor(System.Single)">Vector4(float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Vector4.html">Vector4</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Vector4(float value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(value As Single)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value that will be assigned to all components.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Vector4__ctor_" data-uid="C1.Util.DX.Vector4.#ctor*"></a>
<h4 id="C1_Util_DX_Vector4__ctor_System_Single_System_Single_System_Single_System_Single_" data-uid="C1.Util.DX.Vector4.#ctor(System.Single,System.Single,System.Single,System.Single)">Vector4(float, float, float, float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Vector4.html">Vector4</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Vector4(float x, float y, float z, float w)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(x As Single, y As Single, z As Single, w As Single)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>Initial value for the X component of the vector.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>Initial value for the Y component of the vector.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">z</span></td>
      <td><p>Initial value for the Z component of the vector.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">w</span></td>
      <td><p>Initial value for the W component of the vector.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Vector4__ctor_" data-uid="C1.Util.DX.Vector4.#ctor*"></a>
<h4 id="C1_Util_DX_Vector4__ctor_C1_Util_DX_Vector3_System_Single_" data-uid="C1.Util.DX.Vector4.#ctor(C1.Util.DX.Vector3,System.Single)">Vector4(Vector3, float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Vector4.html">Vector4</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Vector4(Vector3 value, float w)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(value As Vector3, w As Single)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Vector3.html">Vector3</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>A vector containing the values with which to initialize the X, Y, and Z components.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">w</span></td>
      <td><p>Initial value for the W component of the vector.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Vector4__ctor_" data-uid="C1.Util.DX.Vector4.#ctor*"></a>
<h4 id="C1_Util_DX_Vector4__ctor_C1_Util_DX_Vector2_System_Single_System_Single_" data-uid="C1.Util.DX.Vector4.#ctor(C1.Util.DX.Vector2,System.Single,System.Single)">Vector4(Vector2, float, float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Vector4.html">Vector4</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Vector4(Vector2 value, float z, float w)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(value As Vector2, z As Single, w As Single)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Vector2.html">Vector2</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>A vector containing the values with which to initialize the X and Y components.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">z</span></td>
      <td><p>Initial value for the Z component of the vector.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">w</span></td>
      <td><p>Initial value for the W component of the vector.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Vector4__ctor_" data-uid="C1.Util.DX.Vector4.#ctor*"></a>
<h4 id="C1_Util_DX_Vector4__ctor_System_Single___" data-uid="C1.Util.DX.Vector4.#ctor(System.Single[])">Vector4(float[])</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Vector4.html">Vector4</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Vector4(float[] values)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(values As Single())</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a>[]</td>
      <td><span class="parametername">values</span></td>
      <td><p>The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>Thrown when <code class="paramref">values</code> is <code>null</code>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></td>
      <td><p>Thrown when <code class="paramref">values</code> contains more or less than four elements.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
