Класс вектор си шарп

Vector Struct

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms.

generic where T : value classpublic value class Vector : IEquatable>, IFormattable
generic public value class Vector : IEquatable>, IFormattable
public struct Vector : IEquatable, IFormattable where T : struct
public readonly struct Vector : IEquatable, IFormattable where T : struct
public readonly struct Vector : IEquatable, IFormattable
type Vector = struct interface IFormattable
type Vector = struct interface IFormattable
Public Structure Vector(Of T) Implements IEquatable(Of Vector(Of T)), IFormattable

Type Parameters

The type of the elements in the vector. T can be any primitive numeric type.

Remarks

The term primitive numeric data type in this article refers to numeric data types that are directly supported by the CPU and have instructions that can manipulate those data types.

Constructors

Constructs a vector from the given read-only span of bytes.

Constructs a vector from the given ReadOnlySpan .

Constructs a vector from the given Span .

Creates a vector whose components are of a specified type.

Creates a vector from a specified array.

Creates a vector from a specified array starting at a specified index position.

Properties

Returns the number of elements stored in the vector.

Gets a value that indicates whether T is supported.

Gets the element at a specified index.

Returns a vector containing all ones.

Returns a vector containing all zeroes.

Methods

Copies the vector to the given Span .

Copies the vector to the given span. .

Copies the vector instance to a specified destination array.

Copies the vector instance to a specified destination array starting at a specified index position.

Returns a value that indicates whether this instance is equal to a specified object.

Returns a value that indicates whether this instance is equal to a specified vector.

Returns the hash code for this instance.

Returns the string representation of this vector using default formatting.

Returns the string representation of this vector using the specified format string to format individual elements.

Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting.

Attempts to copy the vector to the given byte span.

Attempts to copy the vector to the given Span .

Operators

Adds two vectors together.

Returns a new vector by performing a bitwise And operation on each of the elements in two vectors.

Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors.

Divides the first vector by the second.

Returns a value that indicates whether each pair of elements in two specified vectors are equal.

Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors.

Reinterprets the bits of the specified vector into a vector of type Byte.

Reinterprets the bits of the specified vector into a vector of type Double.

Reinterprets the bits of the specified vector into a vector of type Int16.

Reinterprets the bits of the specified vector into a vector of type Int32.

Reinterprets the bits of the specified vector into a vector of type Int64.

Reinterprets the bits of a source vector into a vector of native-sized integers.

Reinterprets the bits of the specified vector into a vector of type SByte.

Reinterprets the bits of the specified vector into a vector of type Single.

Reinterprets the bits of the specified vector into a vector of type UInt16.

Reinterprets the bits of the specified vector into a vector of type UInt32.

Reinterprets the bits of the specified vector into a vector of type UInt64.

Reinterprets the bits of a source vector into a vector of native-sized, unsigned integers.

Returns a value that indicates whether any single pair of elements in the specified vectors is equal.

Multiplies a vector by a specified scalar value.

Multiplies a vector by a specified scalar value.

Returns a new vector whose values are the product of each pair of elements in two specified vectors.

Returns a new vector whose elements are obtained by taking the one’s complement of a specified vector’s elements.

Subtracts the second vector from the first.

Источник

Vector Структура

Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.

Представляет смещение в двумерном пространстве.

public value class Vector : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.VectorConverter))] [System.Serializable] public struct Vector : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.VectorConverter))] public struct Vector : IFormattable
[] [] type Vector = struct interface IFormattable
[] type Vector = struct interface IFormattable
Public Structure Vector Implements IFormattable

Примеры

В следующем примере показано, как добавить две Vector структуры.

// Adds a Vector to a Vector using the overloaded + operator. Vector vector1 = new Vector(20, 30); Vector vector2 = new Vector(45, 70); Vector vectorResult = new Vector(); // vectorResult is equal to (65,100) vectorResult = vector1 + vector2; 
' Adds a Vector to a Vector using the overloaded + operator. Dim vector1 As New Vector(20, 30) Dim vector2 As New Vector(45, 70) Dim vectorResult As New Vector() ' vectorResult is equal to (65,100) vectorResult = vector1 + vector2 

Комментарии

представляет Point фиксированное положение, а представляет Vector направление и величину (например, скорость или ускорение). Таким образом, конечные точки сегмента линии являются точками, но их различие является вектором; то есть направление и длина этого сегмента линии.

В XAML разделителем между X значениями Vector и Y может быть либо запятая, либо пробел.

В некоторых языках и региональных параметрах вместо символа точки в качестве разделителя десятичных разделителей может использоваться символ запятой. Обработка XAML для инвариантного языка и региональных параметров по умолчанию использует en-US в большинстве реализаций обработчика XAML и ожидает, что точка будет десятичным разделителем. При указании Vector в XAML следует избегать использования символа запятой в качестве десятичного разделителя, так как это будет конфликтовать с преобразованием строкового Vector типа значения атрибута X в компоненты и Y .

Использование атрибута XAML

Значения XAML

x
Компонент X вектора. Дополнительные сведения см. в описании свойства X.

y
Компонент Y вектора. Дополнительные сведения см. в описании свойства Y.

Конструкторы

Инициализирует новый экземпляр структуры Vector.

Свойства

Возвращает длину данного вектора.

Возвращает квадрат длины данного вектора.

Получает или задает компонент X данного вектора.

Получает или задает компонент Y данного вектора.

Методы

Перемещает указанную точку по заданному вектору и возвращает результат в виде точки.

Складывает два вектора и возвращает результат в виде структуры Vector.

Извлекает угол (в градусах) между двумя заданными векторами.

Вычисляет векторное произведение двух векторов.

Вычисляет определитель двух векторов.

Делит указанный вектор на заданный скаляр и возвращает результат в виде Vector.

Определяет, является ли указанный объект Object структурой Vector. Если это так, проверяется, имеет ли структура те же значения X и Y, что и данный вектор.

Сравнивает два вектора на наличие равенства.

Сравнивает два указанных вектора на наличие равенства.

Возвращает хэш-код данного вектора.

Умножает указанный скаляр на заданный вектор и возвращает результат в виде Vector.

Умножает указанный вектор на заданный скаляр и возвращает результат в виде Vector.

Преобразует координатное пространство указанного вектора с использованием заданного значения Matrix.

Вычисляет скалярное произведение двух заданных векторов и возвращает результат в виде Double.

Отрицает данный вектор. Вектор имеет ту же величину, что и раньше, но теперь его направление изменилось на противоположное.

Нормализует данный вектор.

Преобразовывает строковое представление вектора в эквивалентную структуру Vector.

Вычитает указанный вектор из другого заданного вектора.

Возвращает строковое представление данной структуры Vector.

Возвращает строковое представление данной структуры Vector с заданными данными форматирования.

Операторы

Перемещает точку по заданному вектору и возвращает результат в виде точки.

Складывает два вектора и возвращает результат в виде вектора.

Делит указанный вектор на заданный скаляр и возвращает результирующий вектор.

Сравнивает два вектора на наличие равенства.

Создает объект Point со значениями X и Y данного вектора.

Создает Size из смещений данного вектора.

Сравнивает два вектора на наличие неравенства.

Умножает указанный скаляр на заданный вектор и возвращает результирующий вектор.

Умножает указанный скаляр на заданный скаляр и возвращает результирующий вектор.

Преобразует координатное пространство указанного вектора с использованием заданного значения Matrix.

Вычисляет скалярное произведение двух заданных векторных структур и возвращает результат в виде Double.

Вычитает один указанный вектор из другого.

Преобразует заданный вектор в отрицательный.

Явные реализации интерфейса

Этот элемент поддерживает инфраструктуру Windows Presentation Foundation (WPF) и не предназначен для использования непосредственно из кода. Описание этого члена см. в разделе ToString(String, IFormatProvider).

Источник

Читайте также:  Css убрать тень кнопки css
Оцените статью