class_docstr: Obstacle-set pathway between a set of attachment points.
  
  Explanation
  ===========
  
  An obstacle-set pathway forms a series of straight-line segment between
  pairs of consecutive points in a set of points. It is similiar to multiple
  linear pathways joined end-to-end. It will not interact with any other
  objects in the system, i.e. an ``ObstacleSetPathway`` will intersect other
  objects to ensure that the path between its pairs of points (its
  attachments) is the shortest possible.
  
  Examples
  ========
  
  To construct an obstacle-set pathway, three or more points are required to
  be passed to the ``attachments`` parameter as a ``tuple``.
  
  >>> from sympy.physics.mechanics import ObstacleSetPathway, Point
  >>> pA, pB, pC, pD = Point('pA'), Point('pB'), Point('pC'), Point('pD')
  >>> obstacle_set_pathway = ObstacleSetPathway(pA, pB, pC, pD)
  >>> obstacle_set_pathway
  ObstacleSetPathway(pA, pB, pC, pD)
  
  The pathway created above isn't very interesting without the positions and
  velocities of its attachment points being described. Without this its not
  possible to describe how the pathway moves, i.e. its length or its
  extension velocity.
  
  >>> from sympy import cos, sin
  >>> from sympy.physics.mechanics import ReferenceFrame
  >>> from sympy.physics.vector import dynamicsymbols
  >>> N = ReferenceFrame('N')
  >>> q = dynamicsymbols('q')
  >>> pO = Point('pO')
  >>> pA.set_pos(pO, N.y)
  >>> pB.set_pos(pO, -N.x)
  >>> pC.set_pos(pA, cos(q) * N.x - (sin(q) + 1) * N.y)
  >>> pD.set_pos(pA, sin(q) * N.x + (cos(q) - 1) * N.y)
  >>> pB.pos_from(pA)
  - N.x - N.y
  >>> pC.pos_from(pA)
  cos(q(t))*N.x + (-sin(q(t)) - 1)*N.y
  >>> pD.pos_from(pA)
  sin(q(t))*N.x + (cos(q(t)) - 1)*N.y
  
  A pathway's length can be accessed via its ``length`` attribute.
  
  >>> obstacle_set_pathway.length.simplify()
  sqrt(2)*(sqrt(cos(q(t)) + 1) + 2)
  
  A pathway's extension velocity can be accessed similarly via its
  ``extension_velocity`` attribute.
  
  >>> obstacle_set_pathway.extension_velocity.simplify()
  -sqrt(2)*sin(q(t))*Derivative(q(t), t)/(2*sqrt(cos(q(t)) + 1))
  
  Parameters
  ==========
  
  attachments : tuple[Point, Point]
      The set of ``Point`` objects that define the segmented obstacle-set
      pathway.
class_docstr_tok: ["Obstacle-set","pathway","between","a","set","of","attachment","points",".","Explanation","===========","An","obstacle-set","pathway","forms","a","series","of","straight-line","segment","between","pairs","of","consecutive","points","in","a","set","of","points",".","It","is","similiar","to","multiple","linear","pathways","joined","end-to-end",".","It","will","not","interact","with","any","other","objects","in","the","system",",","i.e",".","an","``","ObstacleSetPathway","``","will","intersect","other","objects","to","ensure","that","the","path","between","its","pairs","of","points","(","its","attachments",")","is","the","shortest","possible",".","Examples","========","To","construct","an","obstacle-set","pathway",",","three","or","more","points","are","required","to","be","passed","to","the","``","attachments","``","parameter","as","a","``","tuple","``",".",">",">",">","from","sympy.physics.mechanics","import","ObstacleSetPathway",",","Point",">",">",">","pA",",","pB",",","pC",",","pD","=","Point","(","'pA","'",")",",","Point","(","'pB","'",")",",","Point","(","'pC","'",")",",","Point","(","'pD","'",")",">",">",">","obstacle_set_pathway","=","ObstacleSetPathway","(","pA",",","pB",",","pC",",","pD",")",">",">",">","obstacle_set_pathway","ObstacleSetPathway","(","pA",",","pB",",","pC",",","pD",")","The","pathway","created","above","is","n't","very","interesting","without","the","positions","and","velocities","of","its","attachment","points","being","described",".","Without","this","its","not","possible","to","describe","how","the","pathway","moves",",","i.e",".","its","length","or","its","extension","velocity",".",">",">",">","from","sympy","import","cos",",","sin",">",">",">","from","sympy.physics.mechanics","import","ReferenceFrame",">",">",">","from","sympy.physics.vector","import","dynamicsymbols",">",">",">","N","=","ReferenceFrame","(","'N","'",")",">",">",">","q","=","dynamicsymbols","(","'","q","'",")",">",">",">","pO","=","Point","(","'pO","'",")",">",">",">","pA.set_pos","(","pO",",","N.y",")",">",">",">","pB.set_pos","(","pO",",","-N.x",")",">",">",">","pC.set_pos","(","pA",",","cos","(","q",")","*","N.x","-","(","sin","(","q",")","+","1",")","*","N.y",")",">",">",">","pD.set_pos","(","pA",",","sin","(","q",")","*","N.x","+","(","cos","(","q",")","-","1",")","*","N.y",")",">",">",">","pB.pos_from","(","pA",")","-","N.x","-","N.y",">",">",">","pC.pos_from","(","pA",")","cos","(","q","(","t",")",")","*","N.x","+","(","-sin","(","q","(","t",")",")","-","1",")","*","N.y",">",">",">","pD.pos_from","(","pA",")","sin","(","q","(","t",")",")","*","N.x","+","(","cos","(","q","(","t",")",")","-","1",")","*","N.y","A","pathway","'s","length","can","be","accessed","via","its","``","length","``","attribute",".",">",">",">","obstacle_set_pathway.length.simplify","(",")","sqrt","(","2",")","*","(","sqrt","(","cos","(","q","(","t",")",")","+","1",")","+","2",")","A","pathway","'s","extension","velocity","can","be","accessed","similarly","via","its","``","extension_velocity","``","attribute",".",">",">",">","obstacle_set_pathway.extension_velocity.simplify","(",")","-sqrt","(","2",")","*","sin","(","q","(","t",")",")","*","Derivative","(","q","(","t",")",",","t",")","\/","(","2","*","sqrt","(","cos","(","q","(","t",")",")","+","1",")",")","Parameters","==========","attachments",":","tuple","[","Point",",","Point","]","The","set","of","``","Point","``","objects","that","define","the","segmented","obstacle-set","pathway","."]
docstr: Loads required by the equations of motion method classes.
  
  Explanation
  ===========
  
  ``KanesMethod`` requires a list of ``Point``-``Vector`` tuples to be
  passed to the ``loads`` parameters of its ``kanes_equations`` method
  when constructing the equations of motion. This method acts as a
  utility to produce the correctly-structred pairs of points and vectors
  required so that these can be easily concatenated with other items in
  the list of loads and passed to ``KanesMethod.kanes_equations``. These
  loads are also in the correct form to also be passed to the other
  equations of motion method classes, e.g. ``LagrangesMethod``.
  
  Examples
  ========
  
  The below example shows how to generate the loads produced in an
  actuator that follows an obstacle-set pathway between four points and
  produces an expansile force ``F``. First, create a pair of reference
  frames, ``A`` and ``B``, in which the four points ``pA``, ``pB``,
  ``pC``, and ``pD`` will be located. The first two points in frame ``A``
  and the second two in frame ``B``. Frame ``B`` will also be oriented
  such that it relates to ``A`` via a rotation of ``q`` about an axis
  ``N.z`` in a global frame (``N.z``, ``A.z``, and ``B.z`` are parallel).
  
  >>> from sympy.physics.mechanics import (ObstacleSetPathway, Point,
  ...     ReferenceFrame)
  >>> from sympy.physics.vector import dynamicsymbols
  >>> q = dynamicsymbols('q')
  >>> N = ReferenceFrame('N')
  >>> N = ReferenceFrame('N')
  >>> A = N.orientnew('A', 'axis', (0, N.x))
  >>> B = A.orientnew('B', 'axis', (q, N.z))
  >>> pO = Point('pO')
  >>> pA, pB, pC, pD = Point('pA'), Point('pB'), Point('pC'), Point('pD')
  >>> pA.set_pos(pO, A.x)
  >>> pB.set_pos(pO, -A.y)
  >>> pC.set_pos(pO, B.y)
  >>> pD.set_pos(pO, B.x)
  >>> obstacle_set_pathway = ObstacleSetPathway(pA, pB, pC, pD)
  
  Now create a symbol ``F`` to describe the magnitude of the (expansile)
  force that will be produced along the pathway. The list of loads that
  ``KanesMethod`` requires can be produced by calling the pathway's
  ``to_loads`` method with ``F`` passed as the only argument.
  
  >>> from sympy import Symbol
  >>> F = Symbol('F')
  >>> obstacle_set_pathway.to_loads(F)
  [(pA, sqrt(2)*F/2*A.x + sqrt(2)*F/2*A.y),
   (pB, - sqrt(2)*F/2*A.x - sqrt(2)*F/2*A.y),
   (pB, - F/sqrt(2*cos(q(t)) + 2)*A.y - F/sqrt(2*cos(q(t)) + 2)*B.y),
   (pC, F/sqrt(2*cos(q(t)) + 2)*A.y + F/sqrt(2*cos(q(t)) + 2)*B.y),
   (pC, - sqrt(2)*F/2*B.x + sqrt(2)*F/2*B.y),
   (pD, sqrt(2)*F/2*B.x - sqrt(2)*F/2*B.y)]
  
  Parameters
  ==========
  
  force : Expr
      The force acting along the length of the pathway. It is assumed
      that this ``Expr`` represents an expansile force.
docstr_tok: ["Loads","required","by","the","equations","of","motion","method","classes",".","Explanation","===========","``","KanesMethod","``","requires","a","list","of","``","Point","``","-","``","Vector","``","tuples","to","be","passed","to","the","``","loads","``","parameters","of","its","``","kanes_equations","``","method","when","constructing","the","equations","of","motion",".","This","method","acts","as","a","utility","to","produce","the","correctly-structred","pairs","of","points","and","vectors","required","so","that","these","can","be","easily","concatenated","with","other","items","in","the","list","of","loads","and","passed","to","``","KanesMethod.kanes_equations","``",".","These","loads","are","also","in","the","correct","form","to","also","be","passed","to","the","other","equations","of","motion","method","classes",",","e.g",".","``","LagrangesMethod","``",".","Examples","========","The","below","example","shows","how","to","generate","the","loads","produced","in","an","actuator","that","follows","an","obstacle-set","pathway","between","four","points","and","produces","an","expansile","force","``","F","``",".","First",",","create","a","pair","of","reference","frames",",","``","A","``","and","``","B","``",",","in","which","the","four","points","``","pA","``",",","``","pB","``",",","``","pC","``",",","and","``","pD","``","will","be","located",".","The","first","two","points","in","frame","``","A","``","and","the","second","two","in","frame","``","B","``",".","Frame","``","B","``","will","also","be","oriented","such","that","it","relates","to","``","A","``","via","a","rotation","of","``","q","``","about","an","axis","``","N.z","``","in","a","global","frame","(","``","N.z","``",",","``","A.z","``",",","and","``","B.z","``","are","parallel",")",".",">",">",">","from","sympy.physics.mechanics","import","(","ObstacleSetPathway",",","Point",",","...","ReferenceFrame",")",">",">",">","from","sympy.physics.vector","import","dynamicsymbols",">",">",">","q","=","dynamicsymbols","(","'","q","'",")",">",">",">","N","=","ReferenceFrame","(","'N","'",")",">",">",">","N","=","ReferenceFrame","(","'N","'",")",">",">",">","A","=","N.orientnew","(","'","A","'",",","'axis","'",",","(","0",",","N.x",")",")",">",">",">","B","=","A.orientnew","(","'","B","'",",","'axis","'",",","(","q",",","N.z",")",")",">",">",">","pO","=","Point","(","'pO","'",")",">",">",">","pA",",","pB",",","pC",",","pD","=","Point","(","'pA","'",")",",","Point","(","'pB","'",")",",","Point","(","'pC","'",")",",","Point","(","'pD","'",")",">",">",">","pA.set_pos","(","pO",",","A.x",")",">",">",">","pB.set_pos","(","pO",",","-A.y",")",">",">",">","pC.set_pos","(","pO",",","B.y",")",">",">",">","pD.set_pos","(","pO",",","B.x",")",">",">",">","obstacle_set_pathway","=","ObstacleSetPathway","(","pA",",","pB",",","pC",",","pD",")","Now","create","a","symbol","``","F","``","to","describe","the","magnitude","of","the","(","expansile",")","force","that","will","be","produced","along","the","pathway",".","The","list","of","loads","that","``","KanesMethod","``","requires","can","be","produced","by","calling","the","pathway's","``","to_loads","``","method","with","``","F","``","passed","as","the","only","argument",".",">",">",">","from","sympy","import","Symbol",">",">",">","F","=","Symbol","(","'","F","'",")",">",">",">","obstacle_set_pathway.to_loads","(","F",")","[","(","pA",",","sqrt","(","2",")","*","F\/2","*","A.x","+","sqrt","(","2",")","*","F\/2","*","A.y",")",",","(","pB",",","-","sqrt","(","2",")","*","F\/2","*","A.x","-","sqrt","(","2",")","*","F\/2","*","A.y",")",",","(","pB",",","-","F\/sqrt","(","2","*","cos","(","q","(","t",")",")","+","2",")","*","A.y","-","F\/sqrt","(","2","*","cos","(","q","(","t",")",")","+","2",")","*","B.y",")",",","(","pC",",","F\/sqrt","(","2","*","cos","(","q","(","t",")",")","+","2",")","*","A.y","+","F\/sqrt","(","2","*","cos","(","q","(","t",")",")","+","2",")","*","B.y",")",",","(","pC",",","-","sqrt","(","2",")","*","F\/2","*","B.x","+","sqrt","(","2",")","*","F\/2","*","B.y",")",",","(","pD",",","sqrt","(","2",")","*","F\/2","*","B.x","-","sqrt","(","2",")","*","F\/2","*","B.y",")","]","Parameters","==========","force",":","Expr","The","force","acting","along","the","length","of","the","pathway",".","It","is","assumed","that","this","``","Expr","``","represents","an","expansile","force","."]
code: def to_loads(self, force):
      """Loads required by the equations of motion method classes.
  
      Explanation
      ===========
  
      ``KanesMethod`` requires a list of ``Point``-``Vector`` tuples to be
      passed to the ``loads`` parameters of its ``kanes_equations`` method
      when constructing the equations of motion. This method acts as a
      utility to produce the correctly-structred pairs of points and vectors
      required so that these can be easily concatenated with other items in
      the list of loads and passed to ``KanesMethod.kanes_equations``. These
      loads are also in the correct form to also be passed to the other
      equations of motion method classes, e.g. ``LagrangesMethod``.
  
      Examples
      ========
  
      The below example shows how to generate the loads produced in an
      actuator that follows an obstacle-set pathway between four points and
      produces an expansile force ``F``. First, create a pair of reference
      frames, ``A`` and ``B``, in which the four points ``pA``, ``pB``,
      ``pC``, and ``pD`` will be located. The first two points in frame ``A``
      and the second two in frame ``B``. Frame ``B`` will also be oriented
      such that it relates to ``A`` via a rotation of ``q`` about an axis
      ``N.z`` in a global frame (``N.z``, ``A.z``, and ``B.z`` are parallel).
  
      >>> from sympy.physics.mechanics import (ObstacleSetPathway, Point,
      ...     ReferenceFrame)
      >>> from sympy.physics.vector import dynamicsymbols
      >>> q = dynamicsymbols('q')
      >>> N = ReferenceFrame('N')
      >>> N = ReferenceFrame('N')
      >>> A = N.orientnew('A', 'axis', (0, N.x))
      >>> B = A.orientnew('B', 'axis', (q, N.z))
      >>> pO = Point('pO')
      >>> pA, pB, pC, pD = Point('pA'), Point('pB'), Point('pC'), Point('pD')
      >>> pA.set_pos(pO, A.x)
      >>> pB.set_pos(pO, -A.y)
      >>> pC.set_pos(pO, B.y)
      >>> pD.set_pos(pO, B.x)
      >>> obstacle_set_pathway = ObstacleSetPathway(pA, pB, pC, pD)
  
      Now create a symbol ``F`` to describe the magnitude of the (expansile)
      force that will be produced along the pathway. The list of loads that
      ``KanesMethod`` requires can be produced by calling the pathway's
      ``to_loads`` method with ``F`` passed as the only argument.
  
      >>> from sympy import Symbol
      >>> F = Symbol('F')
      >>> obstacle_set_pathway.to_loads(F)
      [(pA, sqrt(2)*F/2*A.x + sqrt(2)*F/2*A.y),
       (pB, - sqrt(2)*F/2*A.x - sqrt(2)*F/2*A.y),
       (pB, - F/sqrt(2*cos(q(t)) + 2)*A.y - F/sqrt(2*cos(q(t)) + 2)*B.y),
       (pC, F/sqrt(2*cos(q(t)) + 2)*A.y + F/sqrt(2*cos(q(t)) + 2)*B.y),
       (pC, - sqrt(2)*F/2*B.x + sqrt(2)*F/2*B.y),
       (pD, sqrt(2)*F/2*B.x - sqrt(2)*F/2*B.y)]
  
      Parameters
      ==========
  
      force : Expr
          The force acting along the length of the pathway. It is assumed
          that this ``Expr`` represents an expansile force.
  
      """
      loads = []
      attachment_pairs = zip(
          self.attachments[:-1], self.attachments[1:]
      )
      for attachment_pair in attachment_pairs:
          relative_position = _point_pair_relative_position(
              *attachment_pair
          )
          length = _point_pair_length(*attachment_pair)
          loads.extend(
              [
                  Force(
                      attachment_pair[0],
                      -force * relative_position / length,
                  ),
                  Force(
                      attachment_pair[1],
                      force * relative_position / length,
                  ),
              ]
          )
      return loads
  
imports: from abc import ABC, abstractmethod
  from sympy.core.singleton import S
  from sympy.physics.mechanics.loads import Force
  from sympy.physics.mechanics.wrapping_geometry import WrappingGeometryBase
  from sympy.physics.vector import Point, dynamicsymbols
label_desc: Use image node_id 6 for calling the ObstacleSetPathway obj's underlying member method code with example usage: obj.to_loads(force) and returns: loads