class_docstr: Super class for all Dyadic-classes.
  
  References
  ==========
  
  .. [1] https://en.wikipedia.org/wiki/Dyadic_tensor
  .. [2] Kane, T., Levinson, D. Dynamics Theory and Applications. 1985
         McGraw-Hill
class_docstr_tok: ["Super","class","for","all","Dyadic-classes",".","References","==========","..","[","1","]","https",":","\/\/en.wikipedia.org\/wiki\/Dyadic_tensor","..","[","2","]","Kane",",","T.",",","Levinson",",","D.","Dynamics","Theory","and","Applications",".","1985","McGraw-Hill"]
docstr: Returns the matrix form of the dyadic with respect to one or two
  coordinate systems.
  
  Parameters
  ==========
  
  system : CoordSys3D
      The coordinate system that the rows and columns of the matrix
      correspond to. If a second system is provided, this
      only corresponds to the rows of the matrix.
  second_system : CoordSys3D, optional, default=None
      The coordinate system that the columns of the matrix correspond
      to.
  
  Examples
  ========
  
  >>> from sympy.vector import CoordSys3D
  >>> N = CoordSys3D('N')
  >>> v = N.i + 2*N.j
  >>> d = v.outer(N.i)
  >>> d.to_matrix(N)
  Matrix([
  [1, 0, 0],
  [2, 0, 0],
  [0, 0, 0]])
  >>> from sympy import Symbol
  >>> q = Symbol('q')
  >>> P = N.orient_new_axis('P', q, N.k)
  >>> d.to_matrix(N, P)
  Matrix([
  [  cos(q),   -sin(q), 0],
  [2*cos(q), -2*sin(q), 0],
  [       0,         0, 0]])
docstr_tok: ["Returns","the","matrix","form","of","the","dyadic","with","respect","to","one","or","two","coordinate","systems",".","Parameters","==========","system",":","CoordSys3D","The","coordinate","system","that","the","rows","and","columns","of","the","matrix","correspond","to",".","If","a","second","system","is","provided",",","this","only","corresponds","to","the","rows","of","the","matrix",".","second_system",":","CoordSys3D",",","optional",",","default=None","The","coordinate","system","that","the","columns","of","the","matrix","correspond","to",".","Examples","========",">",">",">","from","sympy.vector","import","CoordSys3D",">",">",">","N","=","CoordSys3D","(","'N","'",")",">",">",">","v","=","N.i","+","2","*","N.j",">",">",">","d","=","v.outer","(","N.i",")",">",">",">","d.to_matrix","(","N",")","Matrix","(","[","[","1",",","0",",","0","]",",","[","2",",","0",",","0","]",",","[","0",",","0",",","0","]","]",")",">",">",">","from","sympy","import","Symbol",">",">",">","q","=","Symbol","(","'","q","'",")",">",">",">","P","=","N.orient_new_axis","(","'","P","'",",","q",",","N.k",")",">",">",">","d.to_matrix","(","N",",","P",")","Matrix","(","[","[","cos","(","q",")",",","-sin","(","q",")",",","0","]",",","[","2","*","cos","(","q",")",",","-2","*","sin","(","q",")",",","0","]",",","[","0",",","0",",","0","]","]",")"]
code: def to_matrix(self, system, second_system=None):
      """
      Returns the matrix form of the dyadic with respect to one or two
      coordinate systems.
  
      Parameters
      ==========
  
      system : CoordSys3D
          The coordinate system that the rows and columns of the matrix
          correspond to. If a second system is provided, this
          only corresponds to the rows of the matrix.
      second_system : CoordSys3D, optional, default=None
          The coordinate system that the columns of the matrix correspond
          to.
  
      Examples
      ========
  
      >>> from sympy.vector import CoordSys3D
      >>> N = CoordSys3D('N')
      >>> v = N.i + 2*N.j
      >>> d = v.outer(N.i)
      >>> d.to_matrix(N)
      Matrix([
      [1, 0, 0],
      [2, 0, 0],
      [0, 0, 0]])
      >>> from sympy import Symbol
      >>> q = Symbol('q')
      >>> P = N.orient_new_axis('P', q, N.k)
      >>> d.to_matrix(N, P)
      Matrix([
      [  cos(q),   -sin(q), 0],
      [2*cos(q), -2*sin(q), 0],
      [       0,         0, 0]])
  
      """
  
      if second_system is None:
          second_system = system
  
      return Matrix(
          [i.dot(self).dot(j) for i in system for j in second_system]
      ).reshape(3, 3)
  
imports: from __future__ import annotations
  from sympy.vector.basisdependent import BasisDependent, BasisDependentAdd, BasisDependentMul, BasisDependentZero
  from sympy.core import S, Pow
  from sympy.core.expr import AtomicExpr
  from sympy.matrices.immutable import ImmutableDenseMatrix
  import sympy.vector
label_desc: Use image node_id 6 for calling the Dyadic obj's underlying member method code with example usage: obj.to_matrix(system, second_system) and returns: Matrix