AffineHalfSpace[{p1,…,pk+1},w]
represents AffineSpace[{p1,…,pk+1}] extended in the direction w.
AffineHalfSpace[p,{v1,…,vk},w]
represents AffineSpace[p,{v1,…,vk}] extended in the direction w.
AffineHalfSpace
AffineHalfSpace[{p1,…,pk+1},w]
represents AffineSpace[{p1,…,pk+1}] extended in the direction w.
AffineHalfSpace[p,{v1,…,vk},w]
represents AffineSpace[p,{v1,…,vk}] extended in the direction w.
Details
- AffineHalfSpace can be used as a geometric region and graphics primitive.
- AffineHalfSpace represents the region
or
. The dimension is
if the pi are affinely independent or the vi are linearly independent. - AffineHalfSpace can be used in Graphics and Graphics3D.
- AffineHalfSpace will be clipped by PlotRange when rendering.
- Graphics rendering is affected by directives such as Opacity and color as well as:
-
Thickness,Dashing 1-dimensional (
)FaceForm 2-dimensional (
) - For a two-dimensional AffineSpace, FaceForm[front,back] can be used to specify different styles for the front and back, where the front is defined to be in the direction of the normal Cross[v1,v2] or Cross[p2-p1,p3-p1], depending on which input form is used.
Examples
open all close allBasic Examples (3)
An AffineHalfSpace in 2D:
Graphics[AffineHalfSpace[{0, 0}, {{1, -1}}, {1, 1}]]Graphics3D[AffineHalfSpace[{0, 0, 0}, {{-1, 0, 1}, {1, 1, 0}}, {-1, 1, -1}]]Different styles applied to an affine half-space region:
ℛ = AffineHalfSpace[{0, 0, 0}, {{-1, 0, 1}, {1, 1, 0}}, {-1, 1, -1}];{Graphics3D[{Pink, ℛ}], Graphics3D[{EdgeForm[Thick], Pink, ℛ}], Graphics3D[{EdgeForm[Dashed], Pink, ℛ}], Graphics3D[{EdgeForm[Directive[Thick, Dashed, Blue]], Pink, ℛ}]}Determine if points belong to a given affine half-space region:
ℛ = AffineHalfSpace[{0, 0, 0}, {{-1, 0, 1}, {1, 1, 0}}, {-1, 1, -1}];{RegionMember[ℛ, {1, 1, 1}], RegionMember[ℛ, {-1, 0, 0}]}Scope (18)
Graphics (8)
Specification (3)
Define an affine half-space in 3D using two points and a directional vector:
ill = Graphics3D[{PointSize[Medium], Point[{{1, 0, 0}, {0, 0, 1}}], Thick, Arrowheads[Medium], Arrow[Tube[{{1, 0, 0}, {1, 1, 1}}]]}, PlotRange -> 2, Axes -> True];Show[ill, Graphics3D[AffineHalfSpace[{{1, 0, 0}, {0, 0, 1}}, {0, 1, 1}]]]Define the same affine half-space using a point, a tangent vector, and a directional vector:
ill = Graphics3D[{PointSize[Medium], Point[{{1, 0, 0}}], Thick, Arrowheads[Medium], Arrow[Tube[{{{1, 0, 0}, {1, 1, 1}}, {{1, 0, 0}, {0, 0, 1}}}]]}, PlotRange -> 2, Axes -> True];Show[ill, Graphics3D[AffineHalfSpace[{1, 0, 0}, {{-1, 0, 1}}, {0, 1, 1}]]]An affine half-space in 3D defined by a single point and directional vector:
ill = Graphics3D[{PointSize[Medium], Point[{{0, 0, 0}}], Arrowheads[Medium], Thick, Arrow[Tube[{{0, 0, 0}, {0, 1, 1}}]]}, PlotRange -> 2, Axes -> True];Show[ill, Graphics3D[AffineHalfSpace[{{0, 0, 0}}, {0, 1, 1}]]]Affine half-spaces varying in tangent vector:
Table[Graphics3D[AffineHalfSpace[{0, 0, 0}, {{1, Cos[θ], Sin[θ]}}, {1, 1, 1}], ImageSize -> Tiny, PlotLabel -> θ], {θ, 0, π, π / 4}]Affine half-spaces varying in directional vector:
Table[Graphics3D[AffineHalfSpace[{0, 0, 0}, {{1, 0, 0}}, {1, Cos[θ], Sin[θ]}], ImageSize -> Tiny, PlotLabel -> θ], {θ, 0, π, π / 4}]Styling (2)
Color directives specify the color of the affine half-space:
Table[Graphics3D[{c, AffineHalfSpace[{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}, {0, 1, 0}]}], {c, {Red, Green, Yellow, Blue}}]FaceForm and EdgeForm can be used to specify the styles of the faces and edges:
Graphics3D[{FaceForm[Pink], EdgeForm[Directive[Dashed, Thick, Blue]], AffineHalfSpace[{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}, {0, 1, 0}]}]Coordinates (3)
Specify coordinates by fractions of the plot range:
Graphics3D[AffineHalfSpace[{Scaled[{0.5, 0, 0}], Scaled[{0, 0.5, 0}], Scaled[{0.5, 0.5, 0.5}]}, {1, 0, 0}], PlotRange -> {{0, 10}, {0, 10}, {0, 10}}, Axes -> True]Specify scaled offsets from the ordinary coordinates:
Graphics3D[AffineHalfSpace[{Scaled[{0.3, 0.2, 0.5}, {.1, 0, 0}], Scaled[{0, 0, 0.5}, {1, 1, 1}]}, {1, 0, 0}], PlotRange -> {{0, 2}, {0, 2}, {0, 2}}, Axes -> True]Points and vectors can be Dynamic:
DynamicModule[{θ = 0}, {Slider[Dynamic[θ], {0, Pi}], Graphics3D[AffineHalfSpace[{0, 0, 0}, {Dynamic[{1, Cos[θ], Sin[θ]}]}, {0, 1, 1}]]}]Regions (10)
Embedding dimension is the dimension of the coordinates:
RegionEmbeddingDimension[AffineHalfSpace[{{0, 0}, {1, 0}}, {0, 1}]]RegionEmbeddingDimension[AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}}, {0, 0, 1}]]Geometric dimension is the dimension of the region itself:
RegionDimension[AffineHalfSpace[{{0, 0}, {1, 0}}, {0, 1}]]RegionDimension[AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}}, {0, 0, 1}]]ℛ = AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}}, {0, 0, 1}];{RegionMember[ℛ, {2, 2, 0}], RegionMember[ℛ, {0, 0, 1}]}Get the conditions for membership:
RegionMember[ℛ, {x, y, z}]An affine half-space has infinite measure and undefined centroid:
ℛ = AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}}, {0, 0, 1}];RegionMeasure[ℛ]RegionCentroid[ℛ]ℛ = AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}, {1, 0, 0}}, {0, 0, 1}];RegionDistance[ℛ, {0, 0, -3}]SignedRegionDistance[ℛ, {0, 0, -3}]ℛ = AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}, {1, 0, 0}}, {0, 0, 1}];RegionNearest[ℛ, {-1, -2, -3}]pts = Flatten[Table[{Cos[k 2 π / 8]Cos[j π / 8], Sin[k 2 π / 8]Cos[j π / 8], Sin[j π / 8]}, {k, 0, 7}, {j, -3, 3}], 1];
nst = RegionNearest[ℛ, #]& /@ pts;Legended[Graphics3D[{{Opacity[0.5], ℛ}, {Thin, Gray, Line[Transpose[{pts, nst}]]}, {Red, Point[pts]}, {Blue, Point[nst]}}, Boxed -> False], PointLegend[{Red, Blue}, {"start", "nearest"}]]An affine half-space is unbounded:
ℛ = AffineHalfSpace[{{Subscript[x, 0], Subscript[y, 0], Subscript[z, 0]}, {Subscript[x, 1], Subscript[y, 1], Subscript[z, 1]}, {Subscript[x, 2], Subscript[y, 2], Subscript[z, 2]}}, {Subscript[v, x], Subscript[v, y], Subscript[v, z]}];BoundedRegionQ[ℛ]RegionBounds[ℛ]Integrate over an affine half-space:
ℛ = AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}}, {0, 0, 1}];Integrate[Exp[-(z ^ 2 + y ^ 2)], {x, y, z}∈ℛ]Optimize over an affine half-space:
ℛ = AffineHalfSpace[{{1, 1, 1}, {0, 1, 0}}, {0, 0, 1}];Minimize[{x^2 + y^2 + z^2 + 1, {x, y, z}∈ℛ}, {x, y, z}]Solve equations over an affine half-space:
ℛ = AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}}, {0, 0, 1}];Reduce[x^2 + y^2 + z^2 == 1 && {x, y, z}∈ℛ, {x, y, z}]Applications (2)
Visualize the upper half-plane:
Region[AffineHalfSpace[{{0, 0}, {1, 0}}, {0, 1}], Frame -> True]Region[AffineHalfSpace[{{0, 0}, {1, 0}}, {0, -1}], Frame -> True]Region[AffineHalfSpace[{{0, 0}, {0, 1}}, {-1, 0}], Frame -> True]Region[AffineHalfSpace[{{0, 0}, {0, 1}}, {1, 0}], Frame -> True]Visualize the upper half-space:
Region[AffineHalfSpace[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}}, {0, 0, 1}], Boxed -> True]Region[AffineHalfSpace[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}}, {0, 0, -1}], Boxed -> True]Region[AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}, {0, 0, 1}}, {-1, 0, 0}], Boxed -> True]Region[AffineHalfSpace[{{0, 0, 0}, {0, 1, 0}, {0, 0, 1}}, {1, 0, 0}], Boxed -> True]Region[AffineHalfSpace[{{0, 0, 0}, {1, 0, 0}, {0, 0, 1}}, {0, -1, 0}], Boxed -> True]Region[AffineHalfSpace[{{0, 0, 0}, {1, 0, 0}, {0, 0, 1}}, {0, 1, 0}], Boxed -> True]Properties & Relations (6)
HalfLine is a special case of AffineHalfSpace:
Subscript[ℛ, 1] = AffineHalfSpace[{0, 0, 0}, {}, {1, 2, 3}];
Subscript[ℛ, 2] = HalfLine[{0, 0, 0}, {1, 2, 3}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]HalfPlane is a special case of AffineHalfSpace:
Subscript[ℛ, 1] = AffineHalfSpace[{0, 0, 0}, {{1, 2, 3}}, {1, 1, 1}];
Subscript[ℛ, 2] = HalfPlane[{0, 0, 0}, {1, 2, 3}, {1, 1, 1}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]HalfSpace is a special case of AffineHalfSpace:
p = {1, 1, 1};n = {1, 2, 3};
{v1, v2} = NullSpace[{n}];
w = -n;Subscript[ℛ, 1] = AffineHalfSpace[p, {v1, v2}, w];
Subscript[ℛ, 2] = HalfSpace[n, p];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]AffineHalfSpace is a special case of ConicHullRegion:
p = {1, 1, 1, 1};
{v1, v2} = {{-3, 0, 1, 1}, {-2, 1, 0, 4}};
w = {-1, -2, -3, 1};Subscript[ℛ, 1] = AffineHalfSpace[p, {v1, v2}, w];
Subscript[ℛ, 2] = ConicHullRegion[p, {v1, v2}, {w}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]ParametricRegion can represent any AffineHalfSpace in
:
p = {1, 0};v = {1, 2};w = {1, 1};Subscript[ℛ, 1] = ParametricRegion[p + a v + b w, {a, {b, 0, Infinity}}];
Subscript[ℛ, 2] = AffineHalfSpace[p, {v}, w];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]p = {0, 0, 0, 5, 1};{v1, v2, v3} = {{1, 2, 3, 0, 0}, {1, 1, 1, 5, 1}, {1, 1, 1, 1, 1}};w = {0, 1, 0, 1, 0};Subscript[ℛ, 1] = ParametricRegion[p + a v1 + b v2 + c v3 + d w, {a, b, c, {d, 0, Infinity}}];
Subscript[ℛ, 2] = AffineHalfSpace[p, {v1, v2, v3}, w];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]ImplicitRegion can represent any AffineHalfSpacein
:
p = {1, 2};v = {1, 1};w = {1, 0};Subscript[ℛ, 1] = ImplicitRegion[-1 - x + y ≤ 0, {x, y}];Subscript[ℛ, 2] = AffineHalfSpace[p, {v}, w];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]p = {1, 2, 1, 1, 1};{v1, v2} = {{2, 2, 1, 1, 1}, {0, 0, 1, 2, 3}};w = {1, 1, 1, 1, 1};Subscript[ℛ, 1] = ImplicitRegion[1 + x1 - 3 x3 + x5 ≤ 0 && x3 - 2 x4 + x5 == 0 && 1 + x1 - x2 == 0, {x1, x2, x3, x4, x5}];Subscript[ℛ, 2] = AffineHalfSpace[p, {v1, v2}, w];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Neat Examples (1)
A collection of random half-spaces in
:
Table[Graphics[{EdgeForm[Black], {RandomColor[], AffineHalfSpace[RandomReal[{-1, 1}, {2, 2}], RandomReal[{-1, 1}, 2]]}}, ImageSize -> 30, Frame -> True, FrameTicks -> False], {30}]Table[Graphics3D[{EdgeForm[Black], {RandomColor[], AffineHalfSpace[RandomReal[{-1, 1}, {3, 3}], RandomReal[{-1, 1}, 3]]}}, ImageSize -> 30, Boxed -> True, Ticks -> False, PlotRange -> 1], {20}]See Also
Related Guides
History
Text
Wolfram Research (2015), AffineHalfSpace, Wolfram Language function, https://reference.wolfram.com/language/ref/AffineHalfSpace.html.
CMS
Wolfram Language. 2015. "AffineHalfSpace." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AffineHalfSpace.html.
APA
Wolfram Language. (2015). AffineHalfSpace. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AffineHalfSpace.html
BibTeX
@misc{reference.wolfram_2026_affinehalfspace, author="Wolfram Research", title="{AffineHalfSpace}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/AffineHalfSpace.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_affinehalfspace, organization={Wolfram Research}, title={AffineHalfSpace}, year={2015}, url={https://reference.wolfram.com/language/ref/AffineHalfSpace.html}, note=[Accessed: 12-June-2026]}