打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
vectors

Next: Matrix routines Up: Vectors and Matrices Previous: Vectors and Matrices Contents Index

Vectors

  • veczero - Returns the zero vector, {0 0 0}
    Example:vmd > veczeroInfo) 0 0 0

  • (C++) vecadd v1 v2 [v3 ... vn] - Returns the vector sum of all the terms.
    Examples:vmd > vecadd {1 2 3} {4 5 6} {7 8 9} {-11 -11 -11}Info) 1 4 7vmd > vecadd {0.1 0.2 0.4 0.8} {1 1 2 3} {3 1 4 1}Info) 4.1 2.2 6.4 4.8vmd > vecadd 4 5Info) 9

  • (C++) vecsub v1 v2 - Returns the vector subtraction of the second term from the first
    Examples:vmd > vecsub 6 3.2Info) 2.8vmd > vecsub {10 9.8 7} {0.1 0 -0.1}Info) 9.9 9.8 7.1vmd > vecsub {1 2 3 4 5} {6 7 8 9 10}Info) -5 -5 -5 -5 -5

  • (C++) vecscale c v -
  • (C++) vecscale v c - Returns the vector of the scalar value c applied to each term of v
    Examples:vmd > vecscale .2 {1 2 3}Info) 0.2 0.4 0.6vmd > vecscale {-5 4 -3 2} -2Info) 10 -8 6 -4vmd > vecscale -2 3Info) -6

  • vecdot v1 v2 - Returns the scalar dot product of the two vectors
    Examples:vmd > vecdot {1 -2 3} {4 5 6}Info) 12vmd > vecdot {3 4} {3 4}Info) 25vmd > vecdot {1 2 3 4 5} {5 4 3 2 1}Info) 35vmd > vecdot 3 -2Info) -6

  • veccross v1 v2 - Returns the vector cross product of the two vectors.
    Examples:vmd > veccross {1 0 0} {0 1 0}Info) 0 0 1vmd > veccross {2 2 2} {-1 0 0}Info) 0 -2 2

  • veclength v - Returns the scalar length of v (
    )
    Examples:vmd> veclength 5Info) 5.0vmd > veclength {5 12}Info) 13.0vmd > veclength {3 4 12}Info) 13.0vmd > veclength {1 -2 3 -4}Info) 5.47723

  • veclength2 v - Returns the square of the scalar length of v (
    )
    Examples:vmd > veclength2 5Info) 25vmd > veclength2 {5 12}Info) 169vmd > veclength2 {3 4 12}Info) 169vmd > veclength2 {1 -2 3 -4}Info) 30

  • vecnorm v - Returns the vector of length 1 directed along v
    Examples:vmd > vecnorm -10Info) -1.0vmd > vecnorm {1 1 }Info) 0.707109 0.707109vmd > vecnorm {2 -3 1}Info) 0.534522 -0.801783 0.267261vmd > vecnorm {2 2 -2 2 -2 -2}Info) 0.408248 0.408248 -0.408248 0.408248 -0.408248 -0.408248

  • vecdist v1 v2 - Returns the distance between the two vectors (
    )
    Examples:vmd > vecdist -1.5 5.5Info) 7.0vmd > vecdist {0 0 0} {3 4 0}Info) 5.0vmd > vecdist {0 1 2 3 4 5 6} {-6 -5 -4 -3 -2 -1 0}Info) 15.8745

  • vecinvert v - Returns the additive inverse of v (
    v).
    Examples:vmd > vecinvert -11.1Info) 11.1vmd > vecinvert {3 -4 5}Info) -3 4 -5vmd > vecinvert {0 -1 2 -3}Info) 0 1 -2 3



Next: Matrix routines Up: Vectors and Matrices Previous: Vectors and Matrices Contents Index
vmd@ks.uiuc.edu
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
载入中...
Tutorial on VMD scripting
VMD中实现原子的数值着色方法
IDEAS&info WIKI : 幻意生活
products info
我们的陆丰
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服